Skip to content

Improve error message for missing franc-min dependency#60

Merged
EthanThePhoenix38 merged 5 commits intoclaude/configurable-news-reader-G1Gdxfrom
copilot/sub-pr-57-another-one
Feb 14, 2026
Merged

Improve error message for missing franc-min dependency#60
EthanThePhoenix38 merged 5 commits intoclaude/configurable-news-reader-G1Gdxfrom
copilot/sub-pr-57-another-one

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

The error handler for missing franc-min logged "franc-min not available, using feed-declared language only" without telling users how to fix it.

Changes

  • Enhanced error message to include actionable resolution steps
  • Message now explicitly instructs users to run npm install when the package is missing
} catch (e) {
  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');
  detectLang = () => null;
}

This addresses the review feedback that error messages should be informative and include instructions for resolution.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 5, 2026 19:10
Co-authored-by: EthanThePhoenix38 <103653068+EthanThePhoenix38@users.noreply.github.com>
Co-authored-by: EthanThePhoenix38 <103653068+EthanThePhoenix38@users.noreply.github.com>
…ting

Co-authored-by: EthanThePhoenix38 <103653068+EthanThePhoenix38@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues based on feedback for news reader implementation Improve error message for missing franc-min dependency Feb 5, 2026
@EthanThePhoenix38 EthanThePhoenix38 marked this pull request as ready for review February 14, 2026 12:44
Copilot AI review requested due to automatic review settings February 14, 2026 12:44
@EthanThePhoenix38 EthanThePhoenix38 merged commit e9928c7 into claude/configurable-news-reader-G1Gdx Feb 14, 2026
2 checks passed
@EthanThePhoenix38 EthanThePhoenix38 deleted the copilot/sub-pr-57-another-one branch February 14, 2026 12:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the runtime warning emitted when the optional franc-min dependency is unavailable, so users get actionable guidance to restore automatic language detection.

Changes:

  • Replaced the generic franc-min not available... log with a clearer warning.
  • Added an instruction telling users to run npm install to resolve the missing dependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +202 to +203
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');
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants