From 61ee2b454f5c9adacb1dfbbafb36cc0e284ebf1e Mon Sep 17 00:00:00 2001 From: apocelipes Date: Tue, 10 Sep 2024 21:56:42 +0800 Subject: [PATCH] add DUCKDB_INVALID_CONFIGURATION to duckdb.Error (#273) --- errors.go | 2 ++ errors_test.go | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/errors.go b/errors.go index 06112b04..6dc3546e 100644 --- a/errors.go +++ b/errors.go @@ -125,6 +125,7 @@ const ( ErrorTypeMissingExtension // Thrown when an extension is used but not loaded ErrorTypeAutoLoad // Thrown when an extension is used but not loaded ErrorTypeSequence + ErrorTypeInvalidConfiguration // An invalid configuration was detected (e.g. a Secret param was missing, or a required setting not found) ) var errorPrefixMap = map[string]ErrorType{ @@ -170,6 +171,7 @@ var errorPrefixMap = map[string]ErrorType{ "Missing Extension Error": ErrorTypeMissingExtension, "Extension Autoloading Error": ErrorTypeAutoLoad, "Sequence Error": ErrorTypeSequence, + "Invalid Configuration Error": ErrorTypeInvalidConfiguration, } type Error struct { diff --git a/errors_test.go b/errors_test.go index be1e8811..72fc4b08 100644 --- a/errors_test.go +++ b/errors_test.go @@ -383,7 +383,7 @@ func TestGetDuckDBError(t *testing.T) { Msg: "Error: xxx", Type: ErrorTypeUnknownType, }, - // next two for the prefix testing + // next 3 cases for the prefix testing { Msg: "Invalid Error: xxx", Type: ErrorTypeInvalid, @@ -392,6 +392,10 @@ func TestGetDuckDBError(t *testing.T) { Msg: "Invalid Input Error: xxx", Type: ErrorTypeInvalidInput, }, + { + Msg: "Invalid Configuration Error: xxx", + Type: ErrorTypeInvalidConfiguration, + }, } for _, tc := range testCases {