-
-
Notifications
You must be signed in to change notification settings - Fork 11
feat: error notifications in Playnite #895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: error notifications in Playnite #895
Conversation
There was a problem hiding this 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 enhances error handling in the Playnite Web plugin by adding user-facing notifications for common error scenarios during library synchronization and authentication. The changes ensure that users are informed when operations fail through the Playnite notification system.
Key changes:
- Added
IPlayniteAPIparameter toPublishLibraryGraphQLto enable notification display - Implemented error notifications for library sync failures, authentication failures, and connection errors
- Wrapped sync operations in try-catch blocks to handle exceptions gracefully
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| PublishLibraryGraphQL.cs | Added IPlayniteAPI field and error notifications for task faults and GraphQL errors during library sync |
| PlayniteWeb.cs | Added try-catch wrapper in SyncLibraryFromMenu, error notifications for authentication and connection failures, and updated constructor call to pass PlayniteAPI instance |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
apps/PlayniteWebPlugin/src/Services/Publishers/GraphQL/PublishLibraryGraphQL.cs
Outdated
Show resolved
Hide resolved
apps/PlayniteWebPlugin/src/Services/Publishers/GraphQL/PublishLibraryGraphQL.cs
Outdated
Show resolved
Hide resolved
| catch (Exception e) | ||
| { | ||
| var errorMessage = e.InnerException?.Message ?? e.Message; | ||
| logger.Error($"Error occurred while syncing library: {errorMessage}"); | ||
| PlayniteApi.Notifications.Add(new NotificationMessage( | ||
| "PlayniteWebSyncError", | ||
| $"Playnite Web: Library sync failed. {errorMessage}", | ||
| NotificationType.Error | ||
| )); | ||
| } |
Copilot
AI
Nov 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #895 +/- ##
===========================================
+ Coverage 32.68% 81.52% +48.84%
===========================================
Files 10 135 +125
Lines 205 1927 +1722
Branches 45 425 +380
===========================================
+ Hits 67 1571 +1504
- Misses 137 350 +213
- Partials 1 6 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
apps/PlayniteWebMqttPlugin/src/Services/Mqtt/MqttPublisherOptions.cs
Outdated
Show resolved
Hide resolved
| catch (Exception ex) | ||
| { | ||
| logger.Error(ex, "Error occurred while starting MQTT connection."); | ||
| PlayniteApi.Notifications.Add(new NotificationMessage( | ||
| "PlayniteWebMqttConnectionError", | ||
| $"Playnite Web (MQTT): Failed to establish connection. {ex.Message}", | ||
| NotificationType.Error | ||
| )); | ||
| } |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generic catch clause.
0ff0273 to
ca9dcbf
Compare
Implements notifications in Playnite's notification pane for: - Authentication failures when starting the plugin or verifying settings - Connection failures when establishing server connection - Library sync failures (both from GraphQL errors and task exceptions) The notifications use clear error messages that communicate the nature of each failure to help users diagnose issues with the plugin. Resolves #847
…ailures Implements notifications in Playnite's notification pane for MQTT plugin: - Authentication failures when connecting to MQTT broker - Connection failures when establishing MQTT connection The notifications use clear error messages that communicate the nature of each failure to help users diagnose issues with the MQTT plugin. Related to #847
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
ca9dcbf to
b6a96a6
Compare
Provide feedback on errors to users without needing to read logs. Includes authentication errors and sync errors.
Fixes: #847