Skip to content

Commit c8d206b

Browse files
committed
feat: add debug logging for file processing errors
- Import logger for diagnostic messages - Log file access errors at debug level in getEarliestTimestamp() - Helps distinguish between file access issues vs files without timestamps - Maintains existing behavior while improving diagnostics
1 parent c2b2bab commit c8d206b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/data-loader.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { unreachable } from '@core/errorutil';
66
import { sort } from 'fast-sort';
77
import { glob } from 'tinyglobby';
88
import * as v from 'valibot';
9+
import { logger } from './logger.ts';
910
import {
1011
PricingFetcher,
1112
} from './pricing-fetcher.ts';
@@ -151,7 +152,10 @@ export async function getEarliestTimestamp(filePath: string): Promise<Date | nul
151152

152153
return earliestDate;
153154
}
154-
catch {
155+
catch (error) {
156+
// Log file access errors for diagnostics, but continue processing
157+
// This ensures files without timestamps or with access issues are sorted to the end
158+
logger.debug(`Failed to get earliest timestamp for ${filePath}:`, error);
155159
return null;
156160
}
157161
}

0 commit comments

Comments
 (0)