Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of error codes and reliance on string-based custom errors #1655

Open
i64 opened this issue Jun 9, 2023 · 0 comments
Open

Lack of error codes and reliance on string-based custom errors #1655

i64 opened this issue Jun 9, 2023 · 0 comments
Labels
feature New features or missing components of existing features

Comments

@i64
Copy link

i64 commented Jun 9, 2023

The current exposed API of the kuzu needs to include error codes, which hinders effective error handling and logic development. Instead of returning standardized error codes, the library relies on custom error messages represented as strings. This introduces challenges when attempting to check and handle errors programmatically.

char *query = "MATCH (a:Person) WHERE a.isStudent = $1 RETURN COUNT(*)";
kuzu_prepared_statement *preparedStatement = kuzu_connection_prepare(connection, query);

kuzu_prepared_statement_bind_bool(preparedStatement, (char *)"1", true); 
// kuzu_connection_execute() succeeds

kuzu_prepared_statement_bind_int64(preparedStatement, (char *)"1", true); // typo on purpose
// $1 (bool:int64) causes kuzu_connection_execute() to fail, but we don't receive an error code. 
// Handling this error in logic becomes difficult due to the reliance on string-based error representation.

kuzu_prepared_statement_bind_bool(preparedStatement, (char *)"2", true); // typo on purpose
// $2 (undefined) causes kuzu_connection_execute() to fail, but we don't receive an error code. 
// Handling this error in logic becomes difficult due to the reliance on string-based error representation.
@andyfengHKU andyfengHKU added the feature New features or missing components of existing features label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New features or missing components of existing features
Projects
None yet
Development

No branches or pull requests

2 participants