Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: logic error logging #353

Merged
merged 6 commits into from
Dec 19, 2024
Merged

feat: logic error logging #353

merged 6 commits into from
Dec 19, 2024

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented Dec 13, 2024

Proposed Changes

  • Logs logic error stack via Config.logger.error

This is useful in test environments because some frameworks (jest, vitest) cut off errors. This means the framework will only show the unparsed logic error with the PC and opcodes. This PR adds explicit logging with the stack from the LogicError to ensure the developer gets feedback on where the error occurs

await externalClient.send.call({ method: 'error' })
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
expect(e.stack).toMatch(`err <--- Error`)
Copy link
Contributor Author

@joe-p joe-p Dec 13, 2024

Choose a reason for hiding this comment

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

Just noting that this was working before this PR. Just wanted to make the test more explicit to catch any future regressions

Copy link
Contributor

@neilcampbell neilcampbell left a comment

Choose a reason for hiding this comment

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

Nice one!

@neilcampbell neilcampbell merged commit ebd8131 into main Dec 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants