Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Bytecoder / Webassembly exception handling: determine strategy #4

Description

@keesvandieren

WebAssembly exception handling seems to be premature and not yet finalized.

Bytecoder has an option in the Maven plugin plugin to set it:

            <plugin>
                <groupId>de.mirkosertic.bytecoder</groupId>
                <artifactId>bytecoder-mavenplugin</artifactId>
                <version>${bytecoder.version}</version>
                <configuration>
                    <enableExceptionHandling>true</enableExceptionHandling>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

We've tried to use it like this, with Chrome Canary (version: 88.0.4296.0):

        WebAssembly.instantiateStreaming(fetch('main.wasm'), bytecoder.imports)
            .catch(errorred)
            .then(instantiated);

Function errored is called then:

image

Also, the 'then' is still executed afterwards, but result function argument is null. This looks like a buggy implementation in Chrome, or is the error considered non-fatal?

Reference doc: https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md

We've now added an 'exceptions.kt' with an exception factory method, which also logs the exception message and a tag, but this is still a poor man solution.

We consider a solution that also handles 'normal' exceptions properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    waitingWaiting for reaction outside team

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions