handle JSONDecodeError
This commit is contained in:
parent
4d6897eb70
commit
0f5e00618b
@ -1,5 +1,4 @@
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import time
|
|
||||||
import arrow
|
import arrow
|
||||||
import matplotlib
|
import matplotlib
|
||||||
import logging
|
import logging
|
||||||
|
4
main.py
4
main.py
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
import threading
|
import threading
|
||||||
@ -71,7 +71,7 @@ class TradeThread(threading.Thread):
|
|||||||
finally:
|
finally:
|
||||||
Session.flush()
|
Session.flush()
|
||||||
time.sleep(25)
|
time.sleep(25)
|
||||||
except RuntimeError:
|
except (RuntimeError, json.decoder.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