d2js: JSONify compile err msg
This commit is contained in:
parent
6eb792329d
commit
7fd7fea0e7
2 changed files with 2 additions and 1 deletions
|
|
@ -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}
|
||||
}
|
||||
|
|
|
|||
BIN
d2js/js/d2.wasm
Executable file
BIN
d2js/js/d2.wasm
Executable file
Binary file not shown.
Loading…
Reference in a new issue