Skip to content

Commit

Permalink
10001-design-debt: update errorMessageToLog for generic errors after …
Browse files Browse the repository at this point in the history
…talking with Tenille
  • Loading branch information
Mwindo committed Sep 11, 2024
1 parent fe89285 commit 3798525
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions web-client/src/views/FileHandlingHelpers/pdfValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const validatePdf = ({
resolve({
errorInformation: {
errorMessageToDisplay: GENERIC_FILE_ERROR_MESSAGE,
errorMessageToLog: 'Failed to read file as ArrayBuffer.',
errorMessageToLog: `${GENERIC_FILE_ERROR_MESSAGE} Failed to read file as ArrayBuffer.`,
errorType: ErrorTypes.UNKNOWN,
},
isValid: false,
Expand Down Expand Up @@ -66,7 +66,7 @@ export const validatePdf = ({
resolve({
errorInformation: {
errorMessageToDisplay: GENERIC_FILE_ERROR_MESSAGE,
errorMessageToLog: 'An unknown error occurred: ${err}',
errorMessageToLog: `${GENERIC_FILE_ERROR_MESSAGE} An unknown error occurred: ${err}`,
errorType: ErrorTypes.UNKNOWN,
},
isValid: false,
Expand All @@ -75,10 +75,11 @@ export const validatePdf = ({
};

fileReader.onerror = () => {
const error = fileReader?.error ?? 'Unknown error';
resolve({
errorInformation: {
errorMessageToDisplay: GENERIC_FILE_ERROR_MESSAGE,
errorMessageToLog: GENERIC_FILE_ERROR_MESSAGE,
errorMessageToLog: `${GENERIC_FILE_ERROR_MESSAGE} FileReader encountered an error: ${error}.`,
errorType: ErrorTypes.UNKNOWN,
},
isValid: false,
Expand Down

0 comments on commit 3798525

Please sign in to comment.