You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
POST /api/backups returns Spring's default error body, without a message, when a backup fails with an unchecked exception #71
BackupController.createBackup (src/main/java/com/github/backup/web/BackupController.java) catches only IOException from backupService.backupUserRepositories(...). An unchecked exception, such as a GHException raised by github-api while listing repositories (the case already handled for the daemon in #66), escapes the controller.
Current behavior: Spring Boot's default error handling answers 500 with its own body (timestamp, status, error, path), which has no success or message field (the default server.error.include-message is never). The web UI (src/main/resources/static/app.js) then shows only the generic Failed to create backup., with nothing about what failed.
Documented behavior:COMMANDS.md describes 500 Internal Server Error for a failed backup as { "success": false, "message": "Error: ..." }. The command line (run and interactive mode) and the daemon (ScheduledBackupService.runScheduledBackup) already catch Exception, so the web endpoint is the only entry point that handles unchecked failures differently.
Suggested fix: catch Exception in createBackup, as the other entry points do, so an unchecked failure gets the same 500BackupResponse with success: false and the Error: <message> text, and no backup-completed event is reported. Add a BackupControllerTest case that throws a RuntimeException from the mocked service.
Activity
Answer an unchecked backup failure in web mode with the documented er…