This commit is contained in:
Ivan Boldyrev 2024-08-08 18:57:32 +02:00
parent aba0423106
commit 9e2f123dc3
4 changed files with 6 additions and 6 deletions

View File

@ -103,7 +103,7 @@ pub enum CatchableError {
StreamMapError(#[from] StreamMapError),
#[error("Starlark error: {0}")]
StalarkError(air_interpreter_starlark::ExecutionError),
StarlarkError(air_interpreter_starlark::ExecutionError),
}
impl From<LambdaError> for Rc<CatchableError> {

View File

@ -145,7 +145,7 @@ pub enum UncatchableError {
CallArgumentsSerializationFailed(<CallArgumentsRepr as Representation>::SerializeError),
#[error("Starlark error: {0}")]
StalarkError(air_interpreter_starlark::ExecutionError),
StarlarkError(air_interpreter_starlark::ExecutionError),
}
impl ToErrorCode for UncatchableError {

View File

@ -85,8 +85,8 @@ fn classify_starlark_error(err: air_interpreter_starlark::ExecutionError) -> Exe
match err {
// TODO perhaps, Other should be uncatchable
Value(_) | Function(_) | Other(_) => ExecutionError::Catchable(CatchableError::StalarkError(err).into()),
Scope(_) | Lexer(_) | Internal(_) => ExecutionError::Uncatchable(UncatchableError::StalarkError(err)),
Value(_) | Function(_) | Other(_) => ExecutionError::Catchable(CatchableError::StarlarkError(err).into()),
Scope(_) | Lexer(_) | Internal(_) => ExecutionError::Uncatchable(UncatchableError::StarlarkError(err)),
}
}

View File

@ -118,7 +118,7 @@ async fn embed_error_value() {
var)"##;
let result = call_vm!(vm, <_>::default(), script, "", "");
let expected_error = CatchableError::StalarkError(StarlarkExecutionError::Value(
let expected_error = CatchableError::StarlarkError(StarlarkExecutionError::Value(
"error: Operation `+` not supported for types `int` and `string`\n --> dummy.star:2:1\n |\n2 | 42 + \"string\"\n | ^^^^^^^^^^^^^\n |\n".to_owned(),
));
assert_error_eq!(&result, expected_error);
@ -137,7 +137,7 @@ async fn embed_error_lexer() {
var)"##;
let result = call_vm!(vm, <_>::default(), script, "", "");
let expected_error = UncatchableError::StalarkError(StarlarkExecutionError::Lexer(
let expected_error = UncatchableError::StarlarkError(StarlarkExecutionError::Lexer(
"Parse error: unfinished string literal".to_owned(),
));
assert_error_eq!(&result, expected_error);