Skip to content

Commit 192c97f

Browse files
committed
new exception names
1 parent 3e9be00 commit 192c97f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

dbt/adapters/sqlite/connections.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
from dbt.contracts.connection import AdapterResponse
1313
from dbt.contracts.connection import Connection
1414
from dbt.exceptions import (
15-
DatabaseException,
16-
FailedToConnectException,
17-
RuntimeException
15+
DbtDatabaseError,
16+
FailedToConnectError,
17+
DbtRuntimeError
1818
)
1919
from dbt.logger import GLOBAL_LOGGER as logger
2020

@@ -66,7 +66,7 @@ def open(cls, connection: Connection):
6666
handle: sqlite3.Connection = sqlite3.connect(schemas_and_paths['main'])
6767
attached.append(schemas_and_paths['main'])
6868
else:
69-
raise FailedToConnectException("at least one schema must be called 'main'")
69+
raise FailedToConnectError("at least one schema must be called 'main'")
7070

7171
if len(credentials.extensions) > 0:
7272
handle.enable_load_extension(True)
@@ -92,7 +92,7 @@ def open(cls, connection: Connection):
9292
if schema not in attached:
9393
cursor.execute(f"attach '{path}' as '{schema}'")
9494
else:
95-
raise FailedToConnectException(
95+
raise FailedToConnectError(
9696
f"found {path} while scanning schema_directory, but cannot attach it as '{schema}' " +
9797
f"because that schema name is already defined in schemas_and_paths. " +
9898
f"fix your ~/.dbt/profiles.yml file")
@@ -112,7 +112,7 @@ def open(cls, connection: Connection):
112112
connection.handle = None
113113
connection.state = "fail"
114114

115-
raise FailedToConnectException(str(e))
115+
raise FailedToConnectError(str(e))
116116
except Exception as e:
117117
print(f"Unknown error opening SQLite connection: {e}")
118118
raise e
@@ -151,12 +151,12 @@ def exception_handler(self, sql: str):
151151
except sqlite3.DatabaseError as e:
152152
self.release()
153153
logger.debug("sqlite3 error: {}".format(str(e)))
154-
raise DatabaseException(str(e))
154+
raise DbtDatabaseError(str(e))
155155
except Exception as e:
156156
logger.debug("Error running SQL: {}".format(sql))
157157
logger.debug("Rolling back transaction.")
158158
self.release()
159-
raise RuntimeException(str(e))
159+
raise DbtRuntimeError(str(e))
160160

161161
def add_query(
162162
self,

dbt/adapters/sqlite/impl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from dbt.adapters.sqlite import SQLiteConnectionManager
1313
from dbt.adapters.sqlite.relation import SQLiteRelation
1414
from dbt.contracts.graph.manifest import Manifest
15-
from dbt.exceptions import NotImplementedException
15+
from dbt.exceptions import NotImplementedError
1616

1717

1818
class SQLiteAdapter(SQLAdapter):
@@ -93,7 +93,7 @@ def rename_relation(self, from_relation, to_relation):
9393
self.connections.execute(new_definition)
9494

9595
else:
96-
raise NotImplementedException(
96+
raise NotImplementedError(
9797
f"I don't know how to rename this type of relation: {from_relation.type}," +
9898
f" from: {from_relation}, to: {to_relation}")
9999

0 commit comments

Comments
 (0)