use different exit codes for every error circumstance
This commit is contained in:
parent
869e91fc2a
commit
0f0924281c
1 changed files with 3 additions and 3 deletions
6
bitbotd
6
bitbotd
|
@ -86,7 +86,7 @@ log.info("Starting BitBot %s (Python v%s, db %s)",
|
||||||
lock_file = LockFile.LockFile(lock_location)
|
lock_file = LockFile.LockFile(lock_location)
|
||||||
if not lock_file.available():
|
if not lock_file.available():
|
||||||
log.critical("Database is locked. Is BitBot already running?")
|
log.critical("Database is locked. Is BitBot already running?")
|
||||||
sys.exit(1)
|
sys.exit(2)
|
||||||
|
|
||||||
atexit.register(lock_file.unlock)
|
atexit.register(lock_file.unlock)
|
||||||
lock_file.lock()
|
lock_file.lock()
|
||||||
|
@ -159,13 +159,13 @@ if len(server_configs):
|
||||||
if not bot.connect(server):
|
if not bot.connect(server):
|
||||||
log.error("Failed to connect to '%s'" % str(server))
|
log.error("Failed to connect to '%s'" % str(server))
|
||||||
if not args.startup_disconnects:
|
if not args.startup_disconnects:
|
||||||
sys.exit(1)
|
sys.exit(3)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
bot.run()
|
bot.run()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.critical("Unhandled exception: %s", [str(e)], exc_info=True)
|
log.critical("Unhandled exception: %s", [str(e)], exc_info=True)
|
||||||
sys.exit(1)
|
sys.exit(4)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
if utils.cli.bool_input("no servers found, add one?"):
|
if utils.cli.bool_input("no servers found, add one?"):
|
||||||
|
|
Loading…
Reference in a new issue