Skip to content

errorLike constructor can create misleading error #51

@dcramer

Description

@dcramer

I'll caveat all this with I don't know how everythings wired up, so consider this just a point of user feedback.

Vitest was grabbing an unhandled promise rejection, as shown by the second error in this screen grab:

image

The issue is this was getting masked by the new errorLike() call inside of check-error. Whether the call is correct or not I'll leave to someone who knows better, but from a usercode land I'm simply doing a typical throw new Error pattern.

Changing this code (to debug, temporarily) to simply be errorLike(), I was able to grab the actual error:

image

its not obvious to me which package is to blame for the behavior, so apologies if its not here, but as an end-user this was quite frustrating to debug.

For some additional clarity, afaict:

  • check-error did not change at all afaict
  • chai was upgraded (I believe from 4.3.10 to 4.4.1)
  • vitest was upgraded

I'm using lockfiles and given implicit dependencies its a bit hard to bisect, as e.g. downgrading vitest on its own did not resolve this. Will try to debug and update if I can trace to true root cause.

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