Skip to content

Commit

Permalink
Merge pull request #41720 from bernhardoj/fix/41240-set-error-for-fai…
Browse files Browse the repository at this point in the history
…led-receipt

Set receipt error instead of generic error when failed uploading receipt
  • Loading branch information
puneetlath authored May 12, 2024
2 parents 0235a4b + d0d675b commit 3e4a0b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,9 @@ function buildOnyxDataForMoneyRequest(
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transaction.transactionID}`,
value: {
errors: ErrorUtils.getMicroSecondOnyxError('iou.error.genericCreateFailureMessage'),
// Disabling this line since transaction.filename can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
errors: getReceiptError(transaction.receipt, transaction.filename || transaction.receipt?.filename, isScanRequest, errorKey),
pendingAction: null,
pendingFields: clearedPendingFields,
},
Expand Down Expand Up @@ -1397,7 +1399,9 @@ function buildOnyxDataForTrackExpense(
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transaction.transactionID}`,
value: {
errors: ErrorUtils.getMicroSecondOnyxError('iou.error.genericCreateFailureMessage'),
// Disabling this line since transaction.filename can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
errors: getReceiptError(transaction.receipt, transaction.filename || transaction.receipt?.filename, isScanRequest),
pendingAction: null,
pendingFields: clearedPendingFields,
},
Expand Down

0 comments on commit 3e4a0b8

Please sign in to comment.