d2js: updating custom font error code

This commit is contained in:
delfino 2025-02-27 17:30:01 +00:00
parent 940aef38ea
commit 17e5081047
No known key found for this signature in database
GPG key ID: CFE0DD6A770BF48C

View file

@ -212,7 +212,7 @@ func Compile(args []js.Value) (interface{}, error) {
if fontRegular != nil || fontItalic != nil || fontBold != nil || fontSemibold != nil {
fontFamily, err := d2fonts.AddFontFamily("custom", fontRegular, fontItalic, fontBold, fontSemibold)
if err != nil {
return nil, &WASMError{Message: fmt.Sprintf("custom fonts could not be initialized: %s", err.Error()), Code: 500}
return nil, &WASMError{Message: fmt.Sprintf("custom fonts could not be initialized: %s", err.Error()), Code: 400}
}
compileOpts.FontFamily = fontFamily
}