mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	proper messages when uploading fails
This commit is contained in:
		| @@ -99,14 +99,13 @@ export class UploadFileWidgetComponent implements OnInit { | ||||
|             } | ||||
|  | ||||
|           }, error => { | ||||
|             status.updateProgress(FileStatusPhase.FAILED) | ||||
|             switch (error.status) { | ||||
|               case 400: { | ||||
|                 status.message = error.error.document | ||||
|                 this.consumerStatusService.fail(status, error.error.document) | ||||
|                 break; | ||||
|               } | ||||
|               default: { | ||||
|                 status.message = `${error.status} ${error.statusText}` | ||||
|                 this.consumerStatusService.fail(status, `${error.status} ${error.statusText}`) | ||||
|                 break; | ||||
|               } | ||||
|             } | ||||
|   | ||||
| @@ -117,6 +117,12 @@ export class ConsumerStatusService { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   fail(status: FileStatus, message: string) { | ||||
|     status.message = message | ||||
|     status.phase = FileStatusPhase.FAILED | ||||
|     this.documentConsumptionFailedSubject.next(status) | ||||
|   } | ||||
|  | ||||
|   disconnect() { | ||||
|     if (this.statusWebSocked) { | ||||
|       this.statusWebSocked.close() | ||||
| @@ -133,7 +139,7 @@ export class ConsumerStatusService { | ||||
|   } | ||||
|  | ||||
|   dismissAll() { | ||||
|     this.consumerStatus = [] | ||||
|     this.consumerStatus = this.consumerStatus.filter(status => status.phase < FileStatusPhase.SUCCESS) | ||||
|   } | ||||
|  | ||||
|   onDocumentConsumptionFinished() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler