store/enhancedImageBuilderApi: handle empty error data
There's a case where the IB api returns an error without more data in it, though it might be coming from a component which treats the request before the image builder api.
This commit is contained in:
parent
d8bb3485d8
commit
ece0738150
1 changed files with 1 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ import { imageBuilderApi } from './imageBuilderApi';
|
|||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
const errorMessage = (err: any) => {
|
||||
let msg = err.error.statusText;
|
||||
if (err.error.data?.errors[0]?.detail) {
|
||||
if (err.error.data?.errors.length > 0 && err.error.data?.errors[0]?.detail) {
|
||||
msg = err.error.data?.errors[0]?.detail;
|
||||
}
|
||||
return msg;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue