Skip to content
Merged
Changes from all 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
4 changes: 2 additions & 2 deletions src/aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ try {
return langMap[code] || code;
};
} catch (e) {
// Si franc-min n'est pas installé, on utilise une fonction vide
console.error('franc-min not available, using feed-declared language only');
console.error('WARNING: franc-min package not found. Language detection will be limited to feed-declared languages only.');
console.error('To enable automatic language detection, please run: npm install');
Comment on lines +202 to +203
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The catch (e) currently assumes any failure means franc-min is missing and logs "package not found". If require('franc-min') throws for another reason (e.g., corrupted install or unexpected runtime error), this message will be misleading and the real error will be masked. Consider checking e.code === 'MODULE_NOT_FOUND' (and that the message references franc-min) before logging this, and otherwise rethrow or log the original error details.

Suggested change
console.error('WARNING: franc-min package not found. Language detection will be limited to feed-declared languages only.');
console.error('To enable automatic language detection, please run: npm install');
if (e && e.code === 'MODULE_NOT_FOUND' && (e.message || '').includes('franc-min')) {
console.error('WARNING: franc-min package not found. Language detection will be limited to feed-declared languages only.');
console.error('To enable automatic language detection, please run: npm install');
} else {
console.error('ERROR: Failed to initialize franc-min language detection. Falling back to feed-declared languages only.');
console.error(e);
}

Copilot uses AI. Check for mistakes.
detectLang = () => null;
}

Expand Down