Skip to content

Commit

Permalink
feat(SalariesParseErrorsToastDescription): more informative error mes…
Browse files Browse the repository at this point in the history
…sages
  • Loading branch information
mathiazom committed Sep 5, 2024
1 parent 510ef88 commit e976647
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions studio/components/SalaryCsvInput/SalariesInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const SalariesInput = (props: StringInputProps) => {
/>
),
status: "error",
duration: 10000,
});
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
function descriptionOfCsvParseError(error: SalariesParseError): string {
switch (error.error) {
case SalariesParseErrorType.INVALID_FORMAT:
return "File has invalid format";
return "Invalid file type. Only CSV files (extension .csv) are allowed.";
case SalariesParseErrorType.NO_DATA:
return "File is empty";
return "File is empty. Verify the file content and try again";
case SalariesParseErrorType.INVALID_SHAPE:
return `Row ${error.rowNumber} has does not match format '{year},{salary}'`;
return `Row ${error.rowNumber} does not match the format '{year},{salary}'`;
case SalariesParseErrorType.INVALID_DATA:
return `Row ${error.rowNumber} contains invalid data`;
return `Row ${error.rowNumber} contains invalid salary data. Verify that each line has the format '{year},{salary}'.`;
}
}

Expand Down

0 comments on commit e976647

Please sign in to comment.