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 => { |           }, error => { | ||||||
|             status.updateProgress(FileStatusPhase.FAILED) |  | ||||||
|             switch (error.status) { |             switch (error.status) { | ||||||
|               case 400: { |               case 400: { | ||||||
|                 status.message = error.error.document |                 this.consumerStatusService.fail(status, error.error.document) | ||||||
|                 break; |                 break; | ||||||
|               } |               } | ||||||
|               default: { |               default: { | ||||||
|                 status.message = `${error.status} ${error.statusText}` |                 this.consumerStatusService.fail(status, `${error.status} ${error.statusText}`) | ||||||
|                 break; |                 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() { |   disconnect() { | ||||||
|     if (this.statusWebSocked) { |     if (this.statusWebSocked) { | ||||||
|       this.statusWebSocked.close() |       this.statusWebSocked.close() | ||||||
| @@ -133,7 +139,7 @@ export class ConsumerStatusService { | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   dismissAll() { |   dismissAll() { | ||||||
|     this.consumerStatus = [] |     this.consumerStatus = this.consumerStatus.filter(status => status.phase < FileStatusPhase.SUCCESS) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   onDocumentConsumptionFinished() { |   onDocumentConsumptionFinished() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler