Skip to content

Make the HandlerBuilder class a CallableObject #11

@Byloth

Description

@Byloth

Make the HandlerBuilder class extend the CallableObject class.
This will make it easier to use.

e.g.

const handler = new HandlerBuilder()
  .on(ValueError, () => { ... })
  .on(SyntaxError, () => { ... })
  .default(() => { ... });

// example 1
try { ... }
catch (error)
{
  handler(error);
}

// example 2
new Promise([...])
  .catch(handler);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions