Skip to content

Conversation

Mytherin
Copy link
Collaborator

Fixes #5011, partially fixes #5013, fixes #5022

This PR adds a number of improvements around error messages.

ErrorManager

This PR adds an ErrorManager class which can be used to provide extensible error messages. This allows clients or extensions to override any error messages that are thrown through the ErrorManager class. Currently this is used for the shell to provide a more clear error message in case an unsigned extension fails to load, i.e. the regular error:

Extension "postgres.duckdb_extension" could not be loaded because its signature is either missing or invalid and unsigned extensions are disabled by configuration (allow_unsigned_extensions)

Turns into:

Extension "postgres_scanner.duckdb_extension" could not be loaded because its signature is either missing or invalid and unsigned extensions are disabled by configuration.
Start the shell with the -unsigned parameter to allow this (e.g. duckdb -unsigned).

Error Checking in SQLLogicTest

This PR also adds the capability of checking exact error messages in SQLLogicTest. This can be done by providing a query result to a statement error query:

statement error
select 'hello'::int
----
Could not convert string

If an error message is provided we check if the error message is contained in the actually thrown error message.

CSV Error Messages

This PR also improves the error messages thrown in the CSV reader, including better reporting of line numbers when defects are detected.

@Mytherin Mytherin merged commit d4790e5 into duckdb:master Oct 28, 2022
@Mytherin Mytherin deleted the errormanager branch January 7, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant