Skip to content

Commit

Permalink
Simplify wasm.fs
Browse files Browse the repository at this point in the history
  • Loading branch information
StachuDotNet committed May 30, 2022
1 parent 63e6bf3 commit 570ae55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fsharp-backend/src/Wasm/Wasm.fs
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,8 @@ type EvalWorker =
}

let serialized =
let serialize = Json.Vanilla.serialize

try
serialize result
Json.Vanilla.serialize result
with
| e ->
let metadata = Exception.nestedMetadata e
Expand All @@ -352,7 +350,9 @@ type EvalWorker =
System.Console.WriteLine(
$"caught exception: \"{e.Message}\" \"{metadata}\""
)
serialize (Error($"exception: {e.Message}, metadata: {metadata}"))
Json.Vanilla.serialize (
$"exception: {e.Message}, metadata: {metadata}"
)

EvalWorker.postMessage serialized
}

0 comments on commit 570ae55

Please sign in to comment.