forked from open-webui/open-webui
		
	feat: doc upload error handling
This commit is contained in:
		
							parent
							
								
									eddb6fc7b7
								
							
						
					
					
						commit
						1ff3eb8038
					
				
					 3 changed files with 13 additions and 5 deletions
				
			
		|  | @ -29,7 +29,10 @@ | |||
| 	}; | ||||
| 
 | ||||
| 	const uploadDoc = async (file) => { | ||||
| 		const res = await uploadDocToVectorDB(localStorage.token, '', file); | ||||
| 		const res = await uploadDocToVectorDB(localStorage.token, '', file).catch((error) => { | ||||
| 			toast.error(error); | ||||
| 			return null; | ||||
| 		}); | ||||
| 
 | ||||
| 		if (res) { | ||||
| 			await createNewDoc( | ||||
|  | @ -38,7 +41,10 @@ | |||
| 				res.filename, | ||||
| 				transformFileName(res.filename), | ||||
| 				res.filename | ||||
| 			); | ||||
| 			).catch((error) => { | ||||
| 				toast.error(error); | ||||
| 				return null; | ||||
| 			}); | ||||
| 			await documents.set(await getDocs(localStorage.token)); | ||||
| 		} | ||||
| 	}; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek