-
Notifications
You must be signed in to change notification settings - Fork 5
Feature Request: Make error codes unique and distinguishable #7
Copy link
Copy link
Closed
Milestone
Description
Currently most, if not all, error messages return the same error code of 401. That doesn't do much good when trying to react to specific types of errors. Branching on the error message text is bad policy as message text can change without warning.
I propose defining specific error codes for every type of error. A constants file (csv, json struct, tab delimited, etc. -- just something parsable) defining these error codes would be most useful; would help client authors in generating accurate native structs for identifying the various error codes one can expect in API responses.
[
{"code": 200, "id": "SUCCESS", "desc": "Command completed successfully."},
{"code": 401, "id": "INVALID_CREDENTIALS", "desc": "Invalid id or password."},
{"code": 402, "id": "ACCOUNT_EXPIRED", "desc": "Account expired."},
{"code": 403, "id": "MISSING_HASHCODE", "desc": "Required hashcode missing."},
{"code": 444, "id": "STATION_DENIED", "desc": "The requested station id is not in any of the account's registered headends."},
// And so on...
]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels