File tree Expand file tree Collapse file tree
app/workspace/[workspaceId]/knowledge/hooks
lib/uploads/providers/blob Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -257,6 +257,7 @@ export function useKnowledgeUpload(options: UseKnowledgeUploadOptions = {}) {
257257 file,
258258 workspaceId : options . workspaceId ,
259259 context : 'knowledge-base' ,
260+ presignedEndpoint : '/api/files/presigned' ,
260261 presignedOverride : presigned ,
261262 onProgress,
262263 } )
Original file line number Diff line number Diff line change @@ -341,14 +341,19 @@ export async function headBlobObject(
341341 const containerClient = blobServiceClient . getContainerClient ( containerName )
342342 const blockBlobClient = containerClient . getBlockBlobClient ( key )
343343
344- if ( ! ( await blockBlobClient . exists ( ) ) ) {
345- return null
346- }
347-
348- const properties = await blockBlobClient . getProperties ( )
349- return {
350- size : properties . contentLength ?? 0 ,
351- contentType : properties . contentType ,
344+ try {
345+ const properties = await blockBlobClient . getProperties ( )
346+ return {
347+ size : properties . contentLength ?? 0 ,
348+ contentType : properties . contentType ,
349+ }
350+ } catch ( err ) {
351+ const status = ( err as { statusCode ?: number } ) . statusCode
352+ const code = ( err as { code ?: string } ) . code
353+ if ( status === 404 || code === 'BlobNotFound' ) {
354+ return null
355+ }
356+ throw err
352357 }
353358}
354359
You can’t perform that action at this time.
0 commit comments