fix(bulk v2): catch job errors while polling#705
Merged
cristiand391 merged 5 commits intomainfrom Oct 20, 2023
Merged
Conversation
shetzel
approved these changes
Oct 6, 2023
cristiand391
commented
Oct 20, 2023
| job.emit('error', err); | ||
| } | ||
| if (err.message.startsWith('Polling time out')) { | ||
| if (err.name === 'PollingTimeout') { |
Member
Author
There was a problem hiding this comment.
cristiand391
commented
Oct 20, 2023
| } catch (e) { | ||
| const err = e as Error & { jobId: string }; | ||
| if (timeout.minutes === 0 && err.message.includes('Polling time out')) { | ||
| if (timeout.minutes === 0 && err.name === 'JobPollingTimeout') { |
Member
Author
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
requires jsforce/jsforce#1367
when polling for an ingest job status like
await job.poll()jsforce will emit a failure event if the job fails but it doesn't throw so all job errors during polling are swallowed.This PR adds a handler for the
failedevent and makedatacommands throw.failedevent: https://github.com/jsforce/jsforce/blob/8a359d663215081becc63561735b947df759c185/src/api/bulk.ts#L1505What issues does this PR fix or reference?
@W-13502104@