Skip to content

Conversation

@sergey-borovkov
Copy link
Contributor

What does this PR do?

Improves message on missing authentication file.

GitHub issue or Phabricator ticket number?

#270

How has this been tested?

By running CLI without authentication file.

@vpetersson vpetersson requested a review from Copilot December 12, 2025 21:13
Copy link

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

This PR improves the user experience when authentication files are missing by replacing generic error messages with more helpful, actionable feedback. Instead of a cryptic "Failed to load authentication" panic, users now see clear guidance to run screenly login.

Key Changes:

  • Introduced helper functions to provide context-aware authentication error messages
  • Replaced panic-on-error pattern with graceful error handling and user-friendly messages
  • Added test coverage for the new error message formatting

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

"Not logged in. Please run `screenly login` first to authenticate.".to_string()
}
_ => {
format!("Authentication error: {e}. Please run `screenly login` to authenticate.")
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The error message includes a period before 'Please run' which creates awkward punctuation. Consider restructuring to: format!("Authentication error: {}. Please run screenly login to authenticate.", e) or removing the period after {e} if the underlying error already contains terminal punctuation.

Suggested change
format!("Authentication error: {e}. Please run `screenly login` to authenticate.")
format!("Authentication error: {}. Please run `screenly login` to authenticate.", 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant