start adding specific error messages
This commit is contained in:
parent
9b9a614f44
commit
c7154ffb27
|
@ -52,9 +52,9 @@ export function ErrorCard(props: ErrorCardProps) {
|
||||||
sx={{ alignItems: 'center' }}
|
sx={{ alignItems: 'center' }}
|
||||||
>
|
>
|
||||||
<Alert severity='error'>
|
<Alert severity='error'>
|
||||||
{t('loading.progress', image.steps)}
|
{t('loading.progress', image)}
|
||||||
<br />
|
<br />
|
||||||
{getImageErrorReason(image)}
|
{t(getImageErrorReason(image))}
|
||||||
</Alert>
|
</Alert>
|
||||||
<Stack direction='row' spacing={2}>
|
<Stack direction='row' spacing={2}>
|
||||||
<Tooltip title={t('tooltip.retry')}>
|
<Tooltip title={t('tooltip.retry')}>
|
||||||
|
@ -83,10 +83,18 @@ export function selectActions(state: OnnxState) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const IMAGE_ERROR = 'error.image.';
|
||||||
|
export const UNKNOWN_ERROR = `${IMAGE_ERROR}unknown`;
|
||||||
|
|
||||||
export function getImageErrorReason(image: FailedJobResponse | UnknownJobResponse) {
|
export function getImageErrorReason(image: FailedJobResponse | UnknownJobResponse) {
|
||||||
if (image.status === JobStatus.FAILED) {
|
if (image.status === JobStatus.FAILED) {
|
||||||
return image.error;
|
const error = image.error;
|
||||||
|
if (doesExist(error) && error.startsWith(IMAGE_ERROR)) {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${IMAGE_ERROR}.${error}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return UNKNOWN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,10 @@ export const I18N_STRINGS_DE = {
|
||||||
},
|
},
|
||||||
convert: '',
|
convert: '',
|
||||||
error: {
|
error: {
|
||||||
|
image: {
|
||||||
|
memory: '',
|
||||||
|
unknown: '',
|
||||||
|
},
|
||||||
inpaint: {
|
inpaint: {
|
||||||
support: '',
|
support: '',
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,6 +7,10 @@ export const I18N_STRINGS_EN = {
|
||||||
},
|
},
|
||||||
convert: 'Save and Convert',
|
convert: 'Save and Convert',
|
||||||
error: {
|
error: {
|
||||||
|
image: {
|
||||||
|
memory: 'Memory error generating image',
|
||||||
|
unknown: 'Unknown error generating image',
|
||||||
|
},
|
||||||
inpaint: {
|
inpaint: {
|
||||||
support: 'This diffusion model may not support inpainting.',
|
support: 'This diffusion model may not support inpainting.',
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,6 +12,10 @@ export const I18N_STRINGS_ES = {
|
||||||
},
|
},
|
||||||
convert: '',
|
convert: '',
|
||||||
error: {
|
error: {
|
||||||
|
image: {
|
||||||
|
memory: '',
|
||||||
|
unknown: '',
|
||||||
|
},
|
||||||
inpaint: {
|
inpaint: {
|
||||||
support: '',
|
support: '',
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,6 +12,10 @@ export const I18N_STRINGS_FR = {
|
||||||
},
|
},
|
||||||
convert: '',
|
convert: '',
|
||||||
error: {
|
error: {
|
||||||
|
image: {
|
||||||
|
memory: '',
|
||||||
|
unknown: '',
|
||||||
|
},
|
||||||
inpaint: {
|
inpaint: {
|
||||||
support: '',
|
support: '',
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue