mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Merge branch 'main' into feat/install-repoid-folders
This commit is contained in:
commit
6704f77d87
@ -76,15 +76,20 @@ export const addBatchEnqueuedListener = () => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let detail = 'Unknown Error';
|
let detail = 'Unknown Error';
|
||||||
|
let duration = undefined;
|
||||||
if (response.status === 403 && 'body' in response) {
|
if (response.status === 403 && 'body' in response) {
|
||||||
detail = get(response, 'body.detail', 'Unknown Error');
|
detail = get(response, 'body.detail', 'Unknown Error');
|
||||||
} else if (response.status === 403 && 'error' in response) {
|
} else if (response.status === 403 && 'error' in response) {
|
||||||
detail = get(response, 'error.detail', 'Unknown Error');
|
detail = get(response, 'error.detail', 'Unknown Error');
|
||||||
|
} else if (response.status === 403 && 'data' in response) {
|
||||||
|
detail = get(response, 'data.detail', 'Unknown Error');
|
||||||
|
duration = 15000;
|
||||||
}
|
}
|
||||||
toast({
|
toast({
|
||||||
title: t('queue.batchFailedToQueue'),
|
title: t('queue.batchFailedToQueue'),
|
||||||
status: 'error',
|
status: 'error',
|
||||||
description: detail,
|
description: detail,
|
||||||
|
...(duration ? { duration } : {}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
logger('queue').error(
|
logger('queue').error(
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
import { logger } from 'app/logging/logger';
|
import { logger } from 'app/logging/logger';
|
||||||
import { parseify } from 'common/util/serialize';
|
import { parseify } from 'common/util/serialize';
|
||||||
import { controlNetImageProcessed } from 'features/controlNet/store/actions';
|
import { controlNetImageProcessed } from 'features/controlNet/store/actions';
|
||||||
import { controlNetProcessedImageChanged } from 'features/controlNet/store/controlNetSlice';
|
import {
|
||||||
|
clearPendingControlImages,
|
||||||
|
controlNetImageChanged,
|
||||||
|
controlNetProcessedImageChanged,
|
||||||
|
} from 'features/controlNet/store/controlNetSlice';
|
||||||
import { SAVE_IMAGE } from 'features/nodes/util/graphBuilders/constants';
|
import { SAVE_IMAGE } from 'features/nodes/util/graphBuilders/constants';
|
||||||
import { addToast } from 'features/system/store/systemSlice';
|
import { addToast } from 'features/system/store/systemSlice';
|
||||||
import { t } from 'i18next';
|
import { t } from 'i18next';
|
||||||
@ -105,8 +109,32 @@ export const addControlNetImageProcessedListener = () => {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch {
|
} catch (error) {
|
||||||
log.error({ graph: parseify(graph) }, t('queue.graphFailedToQueue'));
|
log.error({ graph: parseify(graph) }, t('queue.graphFailedToQueue'));
|
||||||
|
|
||||||
|
// handle usage-related errors
|
||||||
|
if (error instanceof Object) {
|
||||||
|
if ('data' in error && 'status' in error) {
|
||||||
|
if (error.status === 403) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const detail = (error.data as any)?.detail || 'Unknown Error';
|
||||||
|
dispatch(
|
||||||
|
addToast({
|
||||||
|
title: t('queue.graphFailedToQueue'),
|
||||||
|
status: 'error',
|
||||||
|
description: detail,
|
||||||
|
duration: 15000,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
dispatch(clearPendingControlImages());
|
||||||
|
dispatch(
|
||||||
|
controlNetImageChanged({ controlNetId, controlImage: null })
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
addToast({
|
addToast({
|
||||||
title: t('queue.graphFailedToQueue'),
|
title: t('queue.graphFailedToQueue'),
|
||||||
|
@ -44,8 +44,28 @@ export const addUpscaleRequestedListener = () => {
|
|||||||
{ enqueueResult: parseify(enqueueResult) },
|
{ enqueueResult: parseify(enqueueResult) },
|
||||||
t('queue.graphQueued')
|
t('queue.graphQueued')
|
||||||
);
|
);
|
||||||
} catch {
|
} catch (error) {
|
||||||
log.error({ graph: parseify(graph) }, t('queue.graphFailedToQueue'));
|
log.error({ graph: parseify(graph) }, t('queue.graphFailedToQueue'));
|
||||||
|
|
||||||
|
// handle usage-related errors
|
||||||
|
if (error instanceof Object) {
|
||||||
|
if ('data' in error && 'status' in error) {
|
||||||
|
if (error.status === 403) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
const detail = (error.data as any)?.detail || 'Unknown Error';
|
||||||
|
dispatch(
|
||||||
|
addToast({
|
||||||
|
title: t('queue.graphFailedToQueue'),
|
||||||
|
status: 'error',
|
||||||
|
description: detail,
|
||||||
|
duration: 15000,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dispatch(
|
dispatch(
|
||||||
addToast({
|
addToast({
|
||||||
title: t('queue.graphFailedToQueue'),
|
title: t('queue.graphFailedToQueue'),
|
||||||
|
@ -410,6 +410,9 @@ export const controlNetSlice = createSlice({
|
|||||||
state.isIPAdapterEnabled = false;
|
state.isIPAdapterEnabled = false;
|
||||||
state.ipAdapterInfo = { ...initialIPAdapterState };
|
state.ipAdapterInfo = { ...initialIPAdapterState };
|
||||||
},
|
},
|
||||||
|
clearPendingControlImages: (state) => {
|
||||||
|
state.pendingControlImages = [];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
extraReducers: (builder) => {
|
extraReducers: (builder) => {
|
||||||
builder.addCase(controlNetImageProcessed, (state, action) => {
|
builder.addCase(controlNetImageProcessed, (state, action) => {
|
||||||
@ -474,6 +477,7 @@ export const {
|
|||||||
ipAdapterBeginStepPctChanged,
|
ipAdapterBeginStepPctChanged,
|
||||||
ipAdapterEndStepPctChanged,
|
ipAdapterEndStepPctChanged,
|
||||||
ipAdapterStateReset,
|
ipAdapterStateReset,
|
||||||
|
clearPendingControlImages,
|
||||||
} = controlNetSlice.actions;
|
} = controlNetSlice.actions;
|
||||||
|
|
||||||
export default controlNetSlice.reducer;
|
export default controlNetSlice.reducer;
|
||||||
|
Loading…
Reference in New Issue
Block a user