mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(pipeline): route content-aware resize correctly and improve error messages
- Route resize steps with contentAware=true to the content-aware-resize tool in both single-file and batch pipeline paths - Update HEIC filename extension to .png after decoding so downstream tools don't attempt double-decoding - Wrap per-step errors with step number and tool name for clarity (e.g. "Step 1 (resize): Resize requires width, height, or percentage") - Show first file's step-level error in batch failure messages
This commit is contained in:
@@ -265,9 +265,18 @@ export function usePipelineProcessor() {
|
||||
let errorMsg: string;
|
||||
try {
|
||||
const body = JSON.parse(text);
|
||||
errorMsg = body.details
|
||||
? `${body.error}: ${body.details}`
|
||||
: body.error || `Batch processing failed: ${response.status}`;
|
||||
if (body.errors && Array.isArray(body.errors) && body.errors.length > 0) {
|
||||
// Show the first file's step-level error (all files typically fail at the same step)
|
||||
const first = body.errors[0];
|
||||
errorMsg = first.error;
|
||||
if (body.errors.length > 1) {
|
||||
errorMsg += ` (${body.errors.length} files failed)`;
|
||||
}
|
||||
} else {
|
||||
errorMsg = body.details
|
||||
? `${body.error}: ${body.details}`
|
||||
: body.error || `Batch processing failed: ${response.status}`;
|
||||
}
|
||||
} catch {
|
||||
errorMsg = `Batch processing failed: ${response.status}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user