diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res index ea810c88..e3fdf168 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res @@ -14,8 +14,6 @@ module T = Reducer_Expression_T type errorValue = Reducer_ErrorValue.errorValue type t = T.t -exception ErrorException = Reducer_ErrorValue.ErrorException - /* Recursively evaluate/reduce the expression (Lisp AST/Lambda calculus) */ diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_Lambda.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_Lambda.res index c4ef011e..aa0745ae 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_Lambda.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_Lambda.res @@ -23,7 +23,7 @@ let checkArity = ( let argsLength = Belt.List.length(args) let parametersLength = Js.Array2.length(lambdaValue.parameters) if argsLength !== parametersLength { - raise(ErrorValue.ErrorException(ErrorValue.REArityError(None, parametersLength, argsLength))) + ErrorValue.REArityError(None, parametersLength, argsLength)->ErrorValue.toException } else { args } @@ -38,7 +38,7 @@ let checkArity = ( let checkIfReduced = (args: list) => args->Belt.List.reduceReverse(list{}, (acc, arg) => switch arg { - | IEvSymbol(symbol) => raise(ErrorValue.ErrorException(ErrorValue.RESymbolNotFound(symbol))) + | IEvSymbol(symbol) => ErrorValue.RESymbolNotFound(symbol)->ErrorValue.toException | _ => list{arg, ...acc} } ) @@ -63,7 +63,7 @@ let caseNotFFI = ( let caseFFI = (ffiFn: ExpressionT.ffiFn, args, accessors: ProjectAccessorsT.t) => { switch ffiFn(args->Belt.List.toArray, accessors.environment) { | Ok(value) => value - | Error(value) => raise(ErrorValue.ErrorException(value)) + | Error(value) => value->ErrorValue.toException } }