Skip to content

@pumpkin-plugins/bedrock-addon-manager API / platform/wasi-error / wasiErrorCode

Function: wasiErrorCode() ​

wasiErrorCode(err): string | undefined

Defined in: tools/plugin-kit/src/wasi-error.ts:7

The code of a WASI error. Filesystem and socket errors carry a string such as no-entry or address-in-use; stream errors carry an object such as { tag: 'closed' }.

Parameters ​

err ​

unknown

Whatever was thrown.

Returns ​

string | undefined

The code, or undefined when the error isn't a WASI one.

Pumpkin Plugins documentation