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

fix: make stringifyError handle UserError better (SOFIE-3337) #1220

Merged

Conversation

nytamin
Copy link
Contributor

@nytamin nytamin commented Jul 2, 2024

About the Contributor

This pull request is posted on behalf of the NRK.

Type of Contribution

This is a: Bug fix

Current Behavior

If there is an error in a method run in a job worker, the error logged looks like this:

Ingest operation "mosInsertStory" failed: [object Object] , undefined
 => awaited here:
    at Function.Promise.await (/opt/core/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
    at server/api/ingest/lib.ts:40:12
    at /opt/core/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40

New Behavior

Ingest operation "mosInsertStory" failed: Error: Test error!, Error: Test error!
     at \sofie-core-R50\packages\job-worker\dist\ingest\mosDevice\mosStoryJobs.js:100:19
     at \sofie-core-R50\packages\job-worker\dist\ingest\lock.js:37:38
     at processTicksAndRejections (internal/process/task_queues.js:95:5)
     at async runWithRundownLockInner (\sofie-core-R50\packages\job-worker\dist\ingest\lock.js:111:21)
     at async IngestWorkerChild.runJob (\sofie-core-R50\packages\job-worker\dist\workers\ingest\child.js:88:33), undefined
  => awaited here:
     at Function.Promise.await (AppData\Local\.meteor\packages\promise\0.12.0\npm\node_modules\meteor-promise\promise_server.js:56:12)
     at server/api/ingest/lib.ts:40:12
     at AppData\Local\.meteor\packages\promise\0.12.0\npm\node_modules\meteor-promise\fiber_pool.js:43:40

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

  • This PR affects error logging

Other Information

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@nytamin nytamin requested a review from a team as a code owner July 2, 2024 07:10
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 65.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 57.95%. Comparing base (931a430) to head (0233073).

Files Patch % Lines
packages/shared-lib/src/lib/stringifyError.ts 65.00% 7 Missing ⚠️
Additional details and impacted files
@@                           Coverage Diff                           @@
##           feat/R51-live-status-gateway-on-R50    #1220      +/-   ##
=======================================================================
- Coverage                                57.95%   57.95%   -0.01%     
=======================================================================
  Files                                      485      485              
  Lines                                    79845    79860      +15     
  Branches                                  4140     4152      +12     
=======================================================================
+ Hits                                     46276    46284       +8     
+ Misses                                   33532    33524       -8     
- Partials                                    37       52      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nytamin nytamin changed the title fix: make stringifyError handle UserError better fix: make stringifyError handle UserError better (SOFIE-3337) Jul 2, 2024
@nytamin nytamin merged commit 8712e51 into feat/R51-live-status-gateway-on-R50 Jul 4, 2024
68 checks passed
@nytamin nytamin deleted the fix/stringifyError-UserError branch July 4, 2024 06:35
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.

None yet

2 participants