Error Codes #11123
Closed
karlseguin
started this conversation in
Ideas
Error Codes
#11123
Replies: 1 comment 2 replies
-
D set errors_as_json=true;
D select * from tbl;
{
"exception_type":"Catalog",
"exception_message":"Table with name tbl does not exist!\nDid you mean \"temp.information_schema.tables\"?",
"name":"tbl",
"candidates":"temp.information_schema.tables",
"position":"14",
"type":"Table",
"error_subtype":"MISSING_ENTRY"
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be nice to expose more structured error data, specifically an error code. This would make detecting recoverable errors like a duplicate constraint error, or a table already existing, more reliable and flexible versus having to parse an error string.
In the C API, this could either be exposed as a new function like
duckdb_result_error_code
AND/OR the error string could, as part of the contract, always begin with a prefix (like "(code: 391) Catalog Error: Table with name "XYZ" already exists!".Beta Was this translation helpful? Give feedback.
All reactions