1212from dbt .contracts .connection import AdapterResponse
1313from dbt .contracts .connection import Connection
1414from dbt .exceptions import (
15- DatabaseException ,
16- FailedToConnectException ,
17- RuntimeException
15+ DbtDatabaseError ,
16+ FailedToConnectError ,
17+ DbtRuntimeError
1818)
1919from 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 ,
0 commit comments