aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/helpers/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/helpers/utils.ts')
-rw-r--r--client/src/app/helpers/utils.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/app/helpers/utils.ts b/client/src/app/helpers/utils.ts
index 17eb5effc..d6ac5b9b4 100644
--- a/client/src/app/helpers/utils.ts
+++ b/client/src/app/helpers/utils.ts
@@ -173,8 +173,8 @@ function isXPercentInViewport (el: HTMLElement, percentVisible: number) {
173 ) 173 )
174} 174}
175 175
176function uploadErrorHandler (parameters: { 176function genericUploadErrorHandler (parameters: {
177 err: HttpErrorResponse 177 err: Pick<HttpErrorResponse, 'message' | 'status' | 'headers'>
178 name: string 178 name: string
179 notifier: Notifier 179 notifier: Notifier
180 sticky?: boolean 180 sticky?: boolean
@@ -186,6 +186,9 @@ function uploadErrorHandler (parameters: {
186 if (err instanceof ErrorEvent) { // network error 186 if (err instanceof ErrorEvent) { // network error
187 message = $localize`The connection was interrupted` 187 message = $localize`The connection was interrupted`
188 notifier.error(message, title, null, sticky) 188 notifier.error(message, title, null, sticky)
189 } else if (err.status === HttpStatusCode.INTERNAL_SERVER_ERROR_500) {
190 message = $localize`The server encountered an error`
191 notifier.error(message, title, null, sticky)
189 } else if (err.status === HttpStatusCode.REQUEST_TIMEOUT_408) { 192 } else if (err.status === HttpStatusCode.REQUEST_TIMEOUT_408) {
190 message = $localize`Your ${name} file couldn't be transferred before the set timeout (usually 10min)` 193 message = $localize`Your ${name} file couldn't be transferred before the set timeout (usually 10min)`
191 notifier.error(message, title, null, sticky) 194 notifier.error(message, title, null, sticky)
@@ -216,5 +219,5 @@ export {
216 isInViewport, 219 isInViewport,
217 isXPercentInViewport, 220 isXPercentInViewport,
218 listUserChannels, 221 listUserChannels,
219 uploadErrorHandler 222 genericUploadErrorHandler
220} 223}