Skip to content

Errors occurring while constructing a new apex object are uncaught #8

@hswope-arcweb

Description

@hswope-arcweb

While constructing a new apex object errors occurring establishing the web socket connection are uncaught. For example:

try {
const myapex = new APEX('bad-url');
}
catch (e) {
// the above error can't be caught here because the error throws from a different thread.
}
It is also a questionable practice to perform an async operation in a constructor. It would probably be better to have a separate connect routine which is async. This would make handling errors easier too. Now the only way I could catch the error thrown above was in the process.on('uncaughtException').

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