-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
refactor(worker): Remove redundant Bridge error handling #6875
Conversation
✅ Deploy Preview for novu-stg-vite-dashboard-poc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
apps/worker/src/app/workflow/usecases/execute-bridge-job/execute-bridge-job.usecase.ts
Show resolved
Hide resolved
libs/application-generic/src/usecases/create-execution-details/types/index.ts
Show resolved
Hide resolved
libs/application-generic/src/usecases/execute-bridge-request/execute-bridge-request.usecase.ts
Show resolved
Hide resolved
libs/application-generic/src/usecases/execute-bridge-request/execute-bridge-request.usecase.ts
Outdated
Show resolved
Hide resolved
…xecute-bridge-request.usecase.ts
}); | ||
|
||
let raw = JSON.parse(executionDetailsRequired[0]?.raw ?? ''); | ||
let error = raw.raw.data[0].message; | ||
let error = raw.data[0].message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This raw.raw
stutter was unnecessary and made the UI more difficult to read.
@@ -38,64 +38,68 @@ export const isRegularDigestOutput = ( | |||
|
|||
export const BRIDGE_EXECUTION_ERROR = { | |||
INVALID_BRIDGE_URL: { | |||
code: 'INVALID_BRIDGE_URL', | |||
code: 'InvalidBridgeUrl', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's easier to read a pascal-cased code on the UI, plus Framework uses PascalCase for all the error codes already and we should be consistent.
code: 'UnknownBridgeNonRequestError', | ||
message: (url: string) => | ||
`Unknown bridge non-request error calling \`${url}\``, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making sure that unknown cases also have an error code to refer to.
hooks: { | ||
afterResponse: | ||
command.afterResponse !== undefined ? [command.afterResponse] : [], | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A step to move away from depending on the got
interface for errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
What changed? Why was the change needed?
calculatedDelay
computation to respectgot
needs to review thecomputedValue
, ensuring that the retriable status codes and error codes are respectedafterResponse
hookScreenshots
No retries for
400
error, execution logs now shows only 1 entryNo retries for
408
error, execution logs now shows only 1 entryNo retries for
502
error, execution logs now shows only 1 entryExpand for optional sections
Related enterprise PR
Special notes for your reviewer