This commit is contained in:
Timothy Jaeryang Baek 2026-09-13 20:00:29 -04:00
parent c0fb36c9b8
commit 6786ae1797
2 changed files with 6 additions and 8 deletions

View file

@ -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')
),
)

View 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(