mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-25 19:54:25 +01:00
networks: throw a proper error in 'remote' if the remote network isn't connected
This commit is contained in:
parent
8420587318
commit
7188081511
@ -89,7 +89,7 @@ def remote(irc, source, args):
|
|||||||
try:
|
try:
|
||||||
remoteirc = world.networkobjects[netname]
|
remoteirc = world.networkobjects[netname]
|
||||||
except KeyError: # Unknown network.
|
except KeyError: # Unknown network.
|
||||||
irc.error('No such network "%s" (case sensitive).' % netname)
|
irc.error('No such network %r (case sensitive).' % netname)
|
||||||
REMOTE_IN_USE.clear()
|
REMOTE_IN_USE.clear()
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -97,6 +97,10 @@ def remote(irc, source, args):
|
|||||||
irc.error('Unknown service %r.' % args.service)
|
irc.error('Unknown service %r.' % args.service)
|
||||||
REMOTE_IN_USE.clear()
|
REMOTE_IN_USE.clear()
|
||||||
return
|
return
|
||||||
|
elif not remoteirc.connected.is_set():
|
||||||
|
irc.error('Network %r is not connected.' % netname)
|
||||||
|
REMOTE_IN_USE.clear()
|
||||||
|
return
|
||||||
|
|
||||||
# Force remoteirc.called_in to something private in order to prevent
|
# Force remoteirc.called_in to something private in order to prevent
|
||||||
# accidental information leakage from replies.
|
# accidental information leakage from replies.
|
||||||
|
Loading…
Reference in New Issue
Block a user