mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
style(backend): extract sanitize_error to local vars for readability
This commit is contained in:
@@ -249,6 +249,8 @@ class SQLQueryBlock(Block):
|
||||
else:
|
||||
yield "error", f"Database error: {error_msg}"
|
||||
except psycopg2.ProgrammingError as e:
|
||||
yield "error", f"SQL error: {_sanitize_error(str(e).strip(), connection_string)}"
|
||||
msg = _sanitize_error(str(e).strip(), connection_string)
|
||||
yield "error", f"SQL error: {msg}"
|
||||
except psycopg2.Error as e:
|
||||
yield "error", f"Database error: {_sanitize_error(str(e).strip(), connection_string)}"
|
||||
msg = _sanitize_error(str(e).strip(), connection_string)
|
||||
yield "error", f"Database error: {msg}"
|
||||
|
||||
Reference in New Issue
Block a user