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

hotfix for logging non-Error exceptions from api routes #4286

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

boutell
Copy link
Member

@boutell boutell commented Sep 11, 2023

Summary

Hotfix, see changelog

What are the specific steps to test this change?

Tests pass

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@boutell boutell requested a review from BoDonkey September 11, 2023 20:18
@linear
Copy link

linear bot commented Sep 11, 2023

PRO-4779 Non-Error API route exceptions should not crash structured logging

Right now throwing a string in an API route crashes structured logging, which does not take the application down, but prevents you from seeing the original error.

This is blocking Holon debugging.

it('should fail politely in the weird case of a non-Error exception', async function() {
let msgWas;
const consoleError = console.error;
console.error = msg => {
Copy link
Member Author

Choose a reason for hiding this comment

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

hijack console.error so we can look at the output there to figure out what exactly is being written

@boutell boutell requested review from gregvanbrug and removed request for BoDonkey September 11, 2023 20:19
@boutell boutell merged commit 19a550e into pro-4779-base Sep 11, 2023
6 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