feat: fully qualified path in error msg (#19674)

* feat: fully qualified path in error msg

* import style
This commit is contained in:
Min Idzelis 2025-07-02 09:31:20 -04:00 committed by GitHub
parent f2f3db3a79
commit ca78bc91b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,5 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { join } from 'node:path'; import { join, resolve } from 'node:path';
import { StorageCore } from 'src/cores/storage.core'; import { StorageCore } from 'src/cores/storage.core';
import { OnEvent, OnJob } from 'src/decorators'; import { OnEvent, OnJob } from 'src/decorators';
import { DatabaseLock, JobName, JobStatus, QueueName, StorageFolder, SystemMetadataKey } from 'src/enum'; import { DatabaseLock, JobName, JobStatus, QueueName, StorageFolder, SystemMetadataKey } from 'src/enum';
@ -87,8 +87,9 @@ export class StorageService extends BaseService {
try { try {
await this.storageRepository.readFile(internalPath); await this.storageRepository.readFile(internalPath);
} catch (error) { } catch (error) {
this.logger.error(`Failed to read ${internalPath}: ${error}`); const fullyQualifiedPath = resolve(process.cwd(), internalPath);
throw new ImmichStartupError(`Failed to read "${externalPath} - ${docsMessage}"`); this.logger.error(`Failed to read ${fullyQualifiedPath} (${internalPath}): ${error}`);
throw new ImmichStartupError(`Failed to read: "${externalPath} (${fullyQualifiedPath}) - ${docsMessage}"`);
} }
} }