Skip to content

Commit

Permalink
Merge pull request #2332 from alixander/d2js-compile-err-format
Browse files Browse the repository at this point in the history
d2js: JSONify compile err msg
  • Loading branch information
alixander authored Feb 4, 2025
2 parents 6eb7923 + 7fd7fea commit e7639da
Show file tree
Hide file tree
Showing 2 changed files 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
Binary file added d2js/js/d2.wasm
Binary file not shown.

0 comments on commit e7639da

Please sign in to comment.