ML: Display proper error message thrown by the API

This commit is contained in:
Gustav Hansen 2022-07-13 18:14:01 +02:00
parent 710a39fc0d
commit bd3e82c368
2 changed files with 5 additions and 1 deletions

View File

@ -100,7 +100,10 @@ export const UploadingAssetCard = ({ asset, onCancel, onStatusChange, addUploade
</Card>
{error ? (
<Typography variant="pi" fontWeight="bold" textColor="danger600">
{error.message}
{formatMessage({
id: getTrad(`apiError.${error.response.data.error.message}`),
defaultMessage: error.response.data.error.message,
})}
</Typography>
) : (
undefined

View File

@ -1,4 +1,5 @@
{
"apiError.FileTooBig": "The uploaded file exceeds the maximum allowed asset size.",
"bulk.select.label": "Select all assets",
"button.next": "Next",
"checkControl.crop-duplicate": "Duplicate & crop the asset",