Skip to content

Flattening out the Error module, couple other comments on it #113

Open
@jmagaram

Description

@jmagaram

I've been looking at the Error module. It is hard to raise exceptions because each of the different types are exposed in sub-modules like Error.SyntaxError that contain a single function - raise. At a glance you can't tell what the different types of exceptions are and must navigate into the sub-module to do it. The Intellisense menu looks like this...

image

I much prefer the Js.Exn way of doing it.

image

I notice an Error.make function. Is there anything you can do with it before raising it? Because if not, just remove make and go straight to throwing. If we want the ability to add custom properties first, I'm not sure how you'd do that. Consider adding some of the get and set functions from Object or convert to object.

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