capture stderr on good calculations
This commit is contained in:
parent
ea2285ed1d
commit
dc0c4a8d32
3
bot.py
3
bot.py
@ -101,8 +101,11 @@ class BotClient(discord.Client):
|
|||||||
proc = sp.run(
|
proc = sp.run(
|
||||||
["node", "calc_main.js", "--"] + args, stdout=sp.PIPE, stderr=sp.PIPE
|
["node", "calc_main.js", "--"] + args, stdout=sp.PIPE, stderr=sp.PIPE
|
||||||
)
|
)
|
||||||
|
stderr = proc.stderr.decode()
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
raise Exception(proc.stderr.decode())
|
raise Exception(proc.stderr.decode())
|
||||||
|
if stderr:
|
||||||
|
_log.warn(f"running calculation: {stderr}")
|
||||||
return proc.stdout.decode()
|
return proc.stdout.decode()
|
||||||
|
|
||||||
def is_replay(self, message: discord.Message) -> bool:
|
def is_replay(self, message: discord.Message) -> bool:
|
||||||
|
Loading…
Reference in New Issue
Block a user