Skip to content

Feature Request: Make error codes unique and distinguishable #7

@Slugger

Description

@Slugger

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...
]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions