Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

local storage: descriptive error for image upload #436

Merged
merged 4 commits into from
Feb 12, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions smuggler-api/src/steroid/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ export async function createNodeFromLocalBinary({
throw new Error(`reading failed: file is too big ( ${file.size} > 8MiB)`)
}

if (!storage.blob_index.cfg.supportsMime(mime)) {
throw new Error(
`Can't extract search index from '${mime}' files yet, support hasn't been implemented`
)
}

// Launch both upload & index *generation* at the same time, wait until all
// promises are settled.
const [uploadResult, indexResult] = await Promise.allSettled([
Expand Down