Skip to content

Conversation

@jay-tux
Copy link
Contributor

@jay-tux jay-tux commented Oct 2, 2024

Some functions in src/framework/Testee.ts catch a string as if it were an Error:

        .catch((e: Error) => {
            scenarioResult.error = e;
        });

My current fix is to have these catch the error as Error|string and then do a type-check to ensure that scenarioResult.error is always an Error|undefined:

        .catch((e: Error|string) => {
            if(typeof e === 'string') scenarioResult.error = new Error(e);
            else scenarioResult.error = e;
        });

@tolauwae tolauwae added the bug Something isn't working label Oct 2, 2024
@tolauwae tolauwae self-requested a review October 2, 2024 13:24
@tolauwae tolauwae merged commit 710be56 into main Oct 2, 2024
@tolauwae tolauwae deleted the fix/undefined-errors branch October 2, 2024 13:25
Copy link
Member

@tolauwae tolauwae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for a hotfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants