diff options
Diffstat (limited to 'toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Enum.sys.mjs')
-rw-r--r-- | toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Enum.sys.mjs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Enum.sys.mjs b/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Enum.sys.mjs index f7716ac6d8..cbcc256eb9 100644 --- a/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Enum.sys.mjs +++ b/toolkit/components/uniffi-bindgen-gecko-js/src/templates/js/Enum.sys.mjs @@ -16,7 +16,7 @@ export class {{ ffi_converter }} extends FfiConverterArrayBuffer { return {{ enum_.nm() }}.{{ variant.name().to_shouty_snake_case() }} {%- endfor %} default: - return new Error("Unknown {{ enum_.nm() }} variant"); + throw new UniFFITypeError("Unknown {{ enum_.nm() }} variant"); } } @@ -27,7 +27,7 @@ export class {{ ffi_converter }} extends FfiConverterArrayBuffer { return; } {%- endfor %} - return new Error("Unknown {{ enum_.nm() }} variant"); + throw new UniFFITypeError("Unknown {{ enum_.nm() }} variant"); } static computeSize(value) { @@ -72,7 +72,7 @@ export class {{ ffi_converter }} extends FfiConverterArrayBuffer { ); {%- endfor %} default: - return new Error("Unknown {{ enum_.nm() }} variant"); + throw new UniFFITypeError("Unknown {{ enum_.nm() }} variant"); } } @@ -86,7 +86,7 @@ export class {{ ffi_converter }} extends FfiConverterArrayBuffer { return; } {%- endfor %} - return new Error("Unknown {{ enum_.nm() }} variant"); + throw new UniFFITypeError("Unknown {{ enum_.nm() }} variant"); } static computeSize(value) { @@ -100,7 +100,7 @@ export class {{ ffi_converter }} extends FfiConverterArrayBuffer { return totalSize; } {%- endfor %} - return new Error("Unknown {{ enum_.nm() }} variant"); + throw new UniFFITypeError("Unknown {{ enum_.nm() }} variant"); } static checkType(value) { |