Show ExifTool errors in metadata UI with short queue labels.
Store detailMessage from worker failures; inspector shows full text, queue keeps fixed summary messages.
This commit is contained in:
@@ -3,6 +3,7 @@ import { ref } from 'vue';
|
||||
import { useExiftoolStore } from '@/stores/exiftool';
|
||||
import type { MetadataPreviewEntry } from '@/types/metadata/MetadataPreview';
|
||||
import { makeKeyFromFile } from '@/utils/file/makeKeyFromFile';
|
||||
import { resolveErrorMessage } from '@/utils/resolveErrorMessage';
|
||||
|
||||
const METADATA_IDLE_MESSAGE = 'Waiting to load metadata...';
|
||||
const EXIFTOOL_INITIALIZING_MESSAGE = 'Downloading ExifTool…';
|
||||
@@ -17,11 +18,6 @@ const METADATA_IDLE_PREVIEW: MetadataPreviewEntry = {
|
||||
message: METADATA_IDLE_MESSAGE
|
||||
};
|
||||
|
||||
const METADATA_LOAD_ERROR_PREVIEW: MetadataPreviewEntry = {
|
||||
status: 'error',
|
||||
message: METADATA_LOAD_ERROR_MESSAGE
|
||||
};
|
||||
|
||||
const EXIFTOOL_PREPARE_ERROR_PREVIEW: MetadataPreviewEntry = {
|
||||
status: 'error',
|
||||
message: EXIFTOOL_PREPARE_ERROR_MESSAGE
|
||||
@@ -96,9 +92,15 @@ export const useMetadataStore = defineStore('metadata', () => {
|
||||
} catch (error) {
|
||||
console.error('[metadata] read failed', { file: file.name, error });
|
||||
|
||||
setPreviewEntry(key, METADATA_LOAD_ERROR_PREVIEW);
|
||||
const entry: MetadataPreviewEntry = {
|
||||
status: 'error',
|
||||
message: METADATA_LOAD_ERROR_MESSAGE,
|
||||
detailMessage: resolveErrorMessage(error, METADATA_LOAD_ERROR_MESSAGE)
|
||||
};
|
||||
|
||||
return METADATA_LOAD_ERROR_PREVIEW;
|
||||
setPreviewEntry(key, entry);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
let strippedBlob: Blob;
|
||||
@@ -116,6 +118,7 @@ export const useMetadataStore = defineStore('metadata', () => {
|
||||
const entry: MetadataPreviewEntry = {
|
||||
status: 'error',
|
||||
message: METADATA_STRIP_ERROR_MESSAGE,
|
||||
detailMessage: resolveErrorMessage(error, METADATA_STRIP_ERROR_MESSAGE),
|
||||
output
|
||||
};
|
||||
|
||||
@@ -136,9 +139,16 @@ export const useMetadataStore = defineStore('metadata', () => {
|
||||
} catch (error) {
|
||||
console.error('[metadata] read after strip failed', { file: file.name, error });
|
||||
|
||||
setPreviewEntry(key, METADATA_LOAD_ERROR_PREVIEW);
|
||||
const entry: MetadataPreviewEntry = {
|
||||
status: 'error',
|
||||
message: METADATA_LOAD_ERROR_MESSAGE,
|
||||
detailMessage: resolveErrorMessage(error, METADATA_LOAD_ERROR_MESSAGE),
|
||||
output
|
||||
};
|
||||
|
||||
return METADATA_LOAD_ERROR_PREVIEW;
|
||||
setPreviewEntry(key, entry);
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
setStrippedBlob(key, strippedBlob);
|
||||
|
||||
Reference in New Issue
Block a user