File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
+ import sys
2
3
import psycopg
3
4
from psycopg .rows import dict_row
4
5
from uuid import UUID
@@ -42,7 +43,7 @@ def connect(self) -> None:
42
43
log .debug ("Connection successful" )
43
44
except psycopg .DatabaseError as e :
44
45
log .error (f"Error connecting to the database: { e } " )
45
- self . conn = None
46
+ sys . exit ( 2 )
46
47
47
48
def hydrate (self ) -> None :
48
49
if self .conn is None :
@@ -76,7 +77,7 @@ def hydrate(self) -> None:
76
77
self .__users [row ["user_id" ]].workspaces .append (self .__workspaces [row ["organization_id" ]])
77
78
except psycopg .Error as e :
78
79
log .error (f"Error fetching data: { e } " )
79
- return None
80
+ sys . exit ( 2 )
80
81
finally :
81
82
self .close ()
82
83
log .debug (f"Found { len (self .__workspaces )} workspaces in database" )
You can’t perform that action at this time.
0 commit comments