mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-17 23:52:29 +00:00
refac
This commit is contained in:
parent
c0fb36c9b8
commit
6786ae1797
2 changed files with 6 additions and 8 deletions
|
|
@ -461,7 +461,11 @@ async def upload_file_handler(
|
|||
log.exception(e)
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail=ERROR_MESSAGES.DEFAULT('Error uploading file'),
|
||||
detail=(
|
||||
ERROR_MESSAGES.EMPTY_CONTENT
|
||||
if isinstance(e, ValueError) and e.args == (ERROR_MESSAGES.EMPTY_CONTENT,)
|
||||
else ERROR_MESSAGES.DEFAULT('Error uploading file')
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -328,10 +328,7 @@
|
|||
for (const fileItem of newFileItems) {
|
||||
try {
|
||||
console.log(fileItem);
|
||||
const res = await processUrl(localStorage.token, fileItem.url).catch((e) => {
|
||||
console.error('Error processing URL:', e);
|
||||
return null;
|
||||
});
|
||||
const res = await processUrl(localStorage.token, fileItem.url);
|
||||
|
||||
if (res) {
|
||||
console.log(res);
|
||||
|
|
@ -351,9 +348,6 @@
|
|||
knowledge_id: knowledge.id,
|
||||
directory_id: currentDirectoryId,
|
||||
source_url: fileItem.url
|
||||
}).catch((e) => {
|
||||
toast.error(`${e}`);
|
||||
return null;
|
||||
});
|
||||
} else if (uploadedFile?.id) {
|
||||
const linkedKnowledge = await addFileToKnowledgeById(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue