Skip to content

allow users to trap errors from runAsync #21

@bugzpodder

Description

@bugzpodder

Currently errors are trapped by try/catch statement in runAsync, eg:

   runAsync: async (interpreter, code, ...args) => {
        try {
            return await interpreter.doString(clean(code), ...args);
        }
        catch (error) {
            io.get(interpreter).stderr(error);
        }
    },

As a polyscript user I would like to have more granular control on the error being returned from runAsync.

The reason is that there are multiple scripts running on the page outputting to different parts of the page and I need to know which script caused the error and what the error is. Using io seems too restrictive and I want to be able to handle the error more freely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions