Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom error message not working #2957

Open
Labels
@KieranP

Description

Bug description

Using either:

class LocationOccupied extends Error {
 constructor(message: string) {
 super(`LocationOccupied(${message})`);
 }
}

OR

class LocationOccupied extends Error {
 constructor(message: string) {
 this.message = `LocationOccupied(${message})`;
 }
}

OR

class LocationOccupied extends Error {
 toString(): string {
 return `LocationOccupied(${this.message})`
 }
}

and calling this:

throw new LocationOccupied(`${x}-${y}`)

I'm not getting a custom message:

› wasmer run build/release.wasm
⠁ Compiling to WebAssembly abort: 0-0 in assembly/world.ts(107:7)
› wasmtime run build/release.wasm
abort: 0-0 in assembly/world.ts(107:7)
Error: failed to run main module `build/release.wasm`

Notice only "0-0" is getting output, which is what is passed into the throw.

The change of the message in the custom error class doesn't apply.

Steps to reproduce

See above

AssemblyScript version

v0.28.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /