mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00
better error messages
This commit is contained in:
parent
68a9dd7e05
commit
cc74be9ccc
@ -87,15 +87,15 @@ export class UploadFileWidgetComponent implements OnInit {
|
|||||||
formData.append('document', file, file.name)
|
formData.append('document', file, file.name)
|
||||||
let status = this.consumerStatusService.newFileUpload(file.name)
|
let status = this.consumerStatusService.newFileUpload(file.name)
|
||||||
|
|
||||||
status.message = "Connecting..."
|
status.message = $localize`Connecting...`
|
||||||
|
|
||||||
this.documentService.uploadDocument(formData).subscribe(event => {
|
this.documentService.uploadDocument(formData).subscribe(event => {
|
||||||
if (event.type == HttpEventType.UploadProgress) {
|
if (event.type == HttpEventType.UploadProgress) {
|
||||||
status.updateProgress(FileStatusPhase.UPLOADING, event.loaded, event.total)
|
status.updateProgress(FileStatusPhase.UPLOADING, event.loaded, event.total)
|
||||||
status.message = "Uploading..."
|
status.message = $localize`Uploading...`
|
||||||
} else if (event.type == HttpEventType.Response) {
|
} else if (event.type == HttpEventType.Response) {
|
||||||
status.taskId = event.body["task_id"]
|
status.taskId = event.body["task_id"]
|
||||||
status.message = "Upload complete."
|
status.message = $localize`Waiting for consumer...`
|
||||||
}
|
}
|
||||||
|
|
||||||
}, error => {
|
}, error => {
|
||||||
@ -106,7 +106,7 @@ export class UploadFileWidgetComponent implements OnInit {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
status.message = $localize`An error has occurred while uploading the document. Sorry!`
|
status.message = `${error.status} ${error.statusText}`
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user