Skip to content

Commit

Permalink
slowly bringing more .fs tests back
Browse files Browse the repository at this point in the history
  • Loading branch information
StachuDotNet committed Nov 5, 2024
1 parent 50678db commit b19fc85
Show file tree
Hide file tree
Showing 9 changed files with 1,190 additions and 1,186 deletions.
4 changes: 2 additions & 2 deletions backend/src/BwdServer/Server.fs
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ let initSerializers () =
"Canvas.loadJsonFromDisk"
Json.Vanilla.allow<LibExecution.ProgramTypes.Toplevel.T> "Canvas.loadJsonFromDisk"
// Json.Vanilla.allow<LibCloud.Queue.NotificationData> "eventqueue storage"
// Json.Vanilla.allow<LibCloud.TraceCloudStorage.CloudStorageFormat>
// "TraceCloudStorageFormat"
Json.Vanilla.allow<LibCloud.TraceCloudStorage.CloudStorageFormat>
"TraceCloudStorageFormat"
Json.Vanilla.allow<LibService.Rollbar.HoneycombJson> "Rollbar"

// for Pusher.com payloads
Expand Down
42 changes: 22 additions & 20 deletions backend/src/LibExecution/Execution.fs
Original file line number Diff line number Diff line change
Expand Up @@ -220,23 +220,25 @@ let traceDvals () : Dictionary.T<id, RT.Dval> * RT.Tracing.TraceDval =
(results, trace)


// let rec rteToString
// (state : RT.ExecutionState)
// (rte : RT.RuntimeError)
// : Ply<string> =
// uply {
// let errorMessageFn =
// RT.FQFnName.fqPackage
// PackageIDs.Fn.LanguageTools.RuntimeErrors.Error.toErrorMessage

// let rte = RT.RuntimeError.toDT rte

// let! rteMessage = executeFunction state errorMessageFn [] (NEList.ofList rte [])

// match rteMessage with
// | Ok(RT.DString msg) -> return msg
// | Ok(other) -> return string other
// | Error(_, rte) ->
// debuG "Error converting RTE to string" rte
// return! rteToString state rte
// }
let rec rteToString
(rteToDval : RT.RuntimeError.Error -> RT.Dval)
(state : RT.ExecutionState)
(rte : RT.RuntimeError.Error)
: Ply<string> =
uply {
let errorMessageFn =
RT.FQFnName.fqPackage
PackageIDs.Fn.PrettyPrinter.RuntimeTypes.RuntimeError.toErrorMessage

let rteDval = rteToDval rte

let! rteMessage =
executeFunction state errorMessageFn [] (NEList.ofList rteDval [])

match rteMessage with
| Ok(RT.DString msg) -> return msg
| Ok(other) -> return string other
| Error(rte) ->
debuG "Error converting RTE to string" rte
return! rteToString rteToDval state rte
}
4 changes: 2 additions & 2 deletions backend/src/ProdExec/ProdExec.fs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ let initSerializers () =
// Json.Vanilla.allow<LibExecution.DvalReprInternalRoundtrippable.FormatV0.Dval>
// "RoundtrippableSerializationFormatV0.Dval"
//Json.Vanilla.allow<LibCloud.Queue.NotificationData> "eventqueue storage"
// Json.Vanilla.allow<LibCloud.TraceCloudStorage.CloudStorageFormat>
// "TraceCloudStorageFormat"
Json.Vanilla.allow<LibCloud.TraceCloudStorage.CloudStorageFormat>
"TraceCloudStorageFormat"
Json.Vanilla.allow<LibService.Rollbar.HoneycombJson> "Rollbar"

// for Pusher.com payloads
Expand Down
Loading

0 comments on commit b19fc85

Please sign in to comment.