mirror of
https://github.com/immich-app/immich.git
synced 2024-11-28 09:33:27 +02:00
fix(web): "undefined" in error message when error at uploading (#5973)
This commit is contained in:
parent
733fa28aa2
commit
f7a78618e5
@ -127,10 +127,11 @@ function handleUploadError(asset: File, respBody = '{}', extraMessage?: string)
|
|||||||
try {
|
try {
|
||||||
const res = JSON.parse(respBody);
|
const res = JSON.parse(respBody);
|
||||||
const extraMsg = res ? ' ' + res?.message : '';
|
const extraMsg = res ? ' ' + res?.message : '';
|
||||||
|
const messageSuffix = extraMessage !== undefined ? ` ${extraMessage}` : '';
|
||||||
|
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
type: NotificationType.Error,
|
type: NotificationType.Error,
|
||||||
message: `Cannot upload file ${asset.name} ${extraMsg}${extraMessage}`,
|
message: `Cannot upload file ${asset.name} ${extraMsg}${messageSuffix}`,
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user