Skip to content

Throwing errors vs passing "false, error_message" #2

Open
@CapsAdmin

Description

@CapsAdmin

The typesystem at the moment passes "false, error_message" when something happens which the analyzer uses assertion for. In some cases I need to concatenate multiple errors, like when multiple type errors happen in a union.

This messes up the stack trace which in turn makes it harder to reason about where the error really comes from. I can guess since I wrote the code but sometimes I get confused.

Maybe something about passing the stack as a third value, an error object or keeping track of the current stack trace in a separate module.

I'm trying to write this using normal Lua without any implicit use of helper globals and many dependencies. Ideally I want someone to look at the for instance the tokenizer, easily be able to grasp it, take it out of NattLua without being bogged down by figuring out all the dependencies.

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