From 94fb662d62c99b4a6c1667f6cdeb4f422bf65cc8 Mon Sep 17 00:00:00 2001 From: Josh Pschorr Date: Tue, 12 Mar 2024 11:01:23 -0700 Subject: [PATCH] error cleanup --- partiql-eval/src/error.rs | 10 ++-------- partiql/tests/extension_error.rs | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/partiql-eval/src/error.rs b/partiql-eval/src/error.rs index 2239d1ec..e310931f 100644 --- a/partiql-eval/src/error.rs +++ b/partiql-eval/src/error.rs @@ -45,14 +45,8 @@ pub enum EvaluationError { NotYetImplemented(String), /// Error originating in an extension - #[error("Base Table Expression Error: {0}")] - ExtensioResultError(BaseTableExprResultError), -} - -impl From 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 diff --git a/partiql/tests/extension_error.rs b/partiql/tests/extension_error.rs index 492f1600..6f469fe6 100644 --- a/partiql/tests/extension_error.rs +++ b/partiql/tests/extension_error.rs @@ -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") }); } @@ -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") }); }