Commit 803b3977 authored by echel0n's avatar echel0n

Refactored OperationalError to import from sqlalchemy.exc

parent 872cae7e
......@@ -92,7 +92,7 @@ class API(object):
self.token = self.session.refresh_token(self.token_url, **extra)
except (InvalidClientIdError, MissingTokenError, InvalidGrantError) as e:
latest_exception = "Invalid token error, please re-authenticate by logging into web-ui"
latest_exception = "Invalid token error, please re-authenticate by logging out then logging back in from web-ui"
except requests.exceptions.ReadTimeout:
timeout += timeout
except requests.exceptions.HTTPError as e:
......@@ -111,10 +111,6 @@ class API(object):
if latest_exception:'{!r}'.format(latest_exception))
def exchange_token(self, token, scope='offline_access'):
exchange = {'scope': scope, 'subject_token': token['access_token']}
self.token =**exchange)
def throttle_hook(response, **kwargs):
if "X-RateLimit-Remaining" in response.headers:
......@@ -21,7 +21,6 @@ import pickle
import shutil
import sqlite3
from collections import OrderedDict
from sqlite3 import OperationalError
from time import sleep
import sqlalchemy
......@@ -29,6 +28,7 @@ from migrate import DatabaseAlreadyControlledError, DatabaseNotControlledError
from migrate.versioning import api
from sqlalchemy import create_engine, event, inspect
from sqlalchemy.engine import Engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import sessionmaker, mapper
from sqlalchemy.pool import QueuePool
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment