nrkno / sofie-core

Sofie Core: A Part of the Sofie TV Studio Automation System
https://github.com/nrkno/Sofie-TV-automation/
MIT License
124 stars 40 forks source link

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

Closed nytamin closed 1 day ago

nytamin commented 3 days ago

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

Affected areas

Other Information

Status

codecov[bot] commented 3 days ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.