diff --git a/libs/user-facing-errors/src/query_engine/mod.rs b/libs/user-facing-errors/src/query_engine/mod.rs index a09a8563621..44e81b90992 100644 --- a/libs/user-facing-errors/src/query_engine/mod.rs +++ b/libs/user-facing-errors/src/query_engine/mod.rs @@ -336,3 +336,11 @@ pub struct ExternalError { pub struct TooManyConnections { pub message: String, } + +// Note: Error code "P2038" is reserved for ClientEngine specific errors. + +#[derive(Debug, UserFacingError, Serialize)] +#[user_facing(code = "P2039", message = "Query Error: {message}")] +pub struct QueryError { + pub message: String, +} diff --git a/query-engine/connectors/query-connector/src/error.rs b/query-engine/connectors/query-connector/src/error.rs index 6e6e37b1d16..f412f33f842 100644 --- a/query-engine/connectors/query-connector/src/error.rs +++ b/query-engine/connectors/query-connector/src/error.rs @@ -125,6 +125,11 @@ impl ConnectorError { message: format!("{}", e), }, )), + + ErrorKind::QueryError(e) => Some(KnownError::new(user_facing_errors::query_engine::QueryError { + message: format!("{}", e), + })), + _ => None, };