mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 04:32:51 +01:00
commands: Add a helpful error message instead of OSError when a subprocess can't be started.
This commit is contained in:
parent
0e2b0a96c8
commit
76ead86e2c
@ -129,7 +129,17 @@ def process(f, *args, **kwargs):
|
|||||||
targetArgs = (f, q,) + args
|
targetArgs = (f, q,) + args
|
||||||
p = callbacks.CommandProcess(target=newf,
|
p = callbacks.CommandProcess(target=newf,
|
||||||
args=targetArgs, kwargs=kwargs)
|
args=targetArgs, kwargs=kwargs)
|
||||||
|
try:
|
||||||
p.start()
|
p.start()
|
||||||
|
except OSError as e:
|
||||||
|
log.error(
|
||||||
|
'Failed to start a subprocess because of the following error: %s '
|
||||||
|
'This might be caused by the way Limnoria is demonized / run in '
|
||||||
|
'the background. Instead, try running it as a service '
|
||||||
|
'<https://docs.limnoria.net/use/supybot-botchk.html>, '
|
||||||
|
'use the --daemon option, or run it in screen/tmux.',
|
||||||
|
e)
|
||||||
|
raise
|
||||||
p.join(timeout)
|
p.join(timeout)
|
||||||
if p.is_alive():
|
if p.is_alive():
|
||||||
p.terminate()
|
p.terminate()
|
||||||
|
Loading…
Reference in New Issue
Block a user