Skip to content

Commit

Permalink
error cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jpschorr committed Mar 12, 2024
1 parent d4906a4 commit 94fb662
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions partiql-eval/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,8 @@ pub enum EvaluationError {
NotYetImplemented(String),

/// Error originating in an extension
#[error("Base Table Expression Error: {0}")]
ExtensioResultError(BaseTableExprResultError),
}

impl From<BaseTableExprResultError> for EvaluationError {
fn from(e: BaseTableExprResultError) -> Self {
EvaluationError::ExtensioResultError(e)
}
#[error("Base Table Expression Error")]
ExtensionResultError(#[from] BaseTableExprResultError),
}

/// Used when an error occurs during the logical to eval plan conversion. Allows the conversion
Expand Down
4 changes: 2 additions & 2 deletions partiql/tests/extension_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ fn test_context_bad_args_strict() {
let err = out.unwrap_err();
assert_eq!(err.errors.len(), 1);
let err = &err.errors[0];
assert_matches!(err, EvaluationError::ExtensioResultError(err) => {
assert_matches!(err, EvaluationError::ExtensionResultError(err) => {
assert_eq!(err.to_string(), "bad arguments")
});
}
Expand Down Expand Up @@ -248,7 +248,7 @@ fn test_context_runtime_strict() {
let err = out.unwrap_err();
assert_eq!(err.errors.len(), 1);
let err = &err.errors[0];
assert_matches!(err, EvaluationError::ExtensioResultError(err) => {
assert_matches!(err, EvaluationError::ExtensionResultError(err) => {
assert_eq!(err.to_string(), "runtime error")
});
}

0 comments on commit 94fb662

Please sign in to comment.