Skip to content

Commit

Permalink
d2js: JSONify compile err msg
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Feb 4, 2025
1 parent 6eb7923 commit eab5ed4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion d2js/d2wasm/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ func Compile(args []js.Value) (interface{}, error) {
}, renderOpts)
if err != nil {
if pe, ok := err.(*d2parser.ParseError); ok {
return nil, &WASMError{Message: pe.Error(), Code: 400}
errs, _ := json.Marshal(pe.Errors)
return nil, &WASMError{Message: string(errs), Code: 400}
}
return nil, &WASMError{Message: err.Error(), Code: 500}
}
Expand Down

0 comments on commit eab5ed4

Please sign in to comment.