Skip to content
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

User friendly message for status in GET /update endpoint #23

Closed
ryneo opened this issue Oct 14, 2016 · 2 comments
Closed

User friendly message for status in GET /update endpoint #23

ryneo opened this issue Oct 14, 2016 · 2 comments
Assignees
Milestone

Comments

@ryneo
Copy link

ryneo commented Oct 14, 2016

The GET /update status endpoint returns a JSON response containing status and log. Parsing the log for a human friendly message is not ideal and error prone.

I propose adding a message property in the JSON response that contains a descriptive message. This is important when a failed status is received. There are several cases where an update would fail such as already up to date, failed to decrypt update package, incorrect checksum of update package, etc. Each case should produce a unique error message to indicate the cause of failure.

Alternatively a code, statusCode or errorCode property could be added which would indicate a failure reason. The consumer of the API can write their own messages from the status code.

In either case, responding to an upgrade failure will become easier.

@aw
Copy link
Member

aw commented Oct 15, 2016

That's not a bad idea. This occasionally trips me up as well when I'm forced to parse the log just to know what happened.

I prefer the status code approach since it's more flexible, and helps with occasionally cryptic error messages from various programs (ex, openssl's bad magic number).

@aw aw self-assigned this Oct 15, 2016
@aw aw added the enhancement label Oct 15, 2016
@aw aw modified the milestone: v1.12 Oct 23, 2016
aw added a commit that referenced this issue Oct 27, 2016
  * Add error-code and error-message to status response. Update API docs. #23
  * Add '/services' #11 and fix '/certs' #22
  * Add jsrrdgraphs, update theme icons, improve UI dashboard, monitor, updates sections
  * Update documentation
@aw
Copy link
Member

aw commented Nov 23, 2016

This has been implemented. The GET /update API endpoint now returns error-code and error-message if the update failed.

@aw aw closed this as completed Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants