fix using JSONDecodeError in two different ways
This commit is contained in:
parent
e229ba0ba8
commit
e82f6e0da8
3
main.py
3
main.py
@ -1,5 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
@ -70,7 +69,7 @@ class TradeThread(threading.Thread):
|
|||||||
finally:
|
finally:
|
||||||
Session.flush()
|
Session.flush()
|
||||||
time.sleep(25)
|
time.sleep(25)
|
||||||
except (RuntimeError, json.decoder.JSONDecodeError) as e:
|
except (RuntimeError, JSONDecodeError) as e:
|
||||||
TelegramHandler.send_msg('*Status:* Got RuntimeError: ```\n{}\n```'.format(traceback.format_exc()))
|
TelegramHandler.send_msg('*Status:* Got RuntimeError: ```\n{}\n```'.format(traceback.format_exc()))
|
||||||
logger.exception('RuntimeError. Stopping trader ...')
|
logger.exception('RuntimeError. Stopping trader ...')
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user