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' }}
|
||||
>
|
||||
<Alert severity='error'>
|
||||
{t('loading.progress', image.steps)}
|
||||
{t('loading.progress', image)}
|
||||
<br />
|
||||
{getImageErrorReason(image)}
|
||||
{t(getImageErrorReason(image))}
|
||||
</Alert>
|
||||
<Stack direction='row' spacing={2}>
|
||||
<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) {
|
||||
if (image.status === JobStatus.FAILED) {
|
||||
return image.error;
|
||||
const error = image.error;
|
||||
if (doesExist(error) && error.startsWith(IMAGE_ERROR)) {
|
||||
return error;
|
||||
}
|
||||
|
||||
return '';
|
||||
return `${IMAGE_ERROR}.${error}`;
|
||||
}
|
||||
|
||||
return UNKNOWN_ERROR;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,10 @@ export const I18N_STRINGS_DE = {
|
|||
},
|
||||
convert: '',
|
||||
error: {
|
||||
image: {
|
||||
memory: '',
|
||||
unknown: '',
|
||||
},
|
||||
inpaint: {
|
||||
support: '',
|
||||
},
|
||||
|
|
|
@ -7,6 +7,10 @@ export const I18N_STRINGS_EN = {
|
|||
},
|
||||
convert: 'Save and Convert',
|
||||
error: {
|
||||
image: {
|
||||
memory: 'Memory error generating image',
|
||||
unknown: 'Unknown error generating image',
|
||||
},
|
||||
inpaint: {
|
||||
support: 'This diffusion model may not support inpainting.',
|
||||
},
|
||||
|
|
|
@ -12,6 +12,10 @@ export const I18N_STRINGS_ES = {
|
|||
},
|
||||
convert: '',
|
||||
error: {
|
||||
image: {
|
||||
memory: '',
|
||||
unknown: '',
|
||||
},
|
||||
inpaint: {
|
||||
support: '',
|
||||
},
|
||||
|
|
|
@ -12,6 +12,10 @@ export const I18N_STRINGS_FR = {
|
|||
},
|
||||
convert: '',
|
||||
error: {
|
||||
image: {
|
||||
memory: '',
|
||||
unknown: '',
|
||||
},
|
||||
inpaint: {
|
||||
support: '',
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue