Skip to content

problem-specific error codes? #81

@r2evans

Description

@r2evans

For discussion: what are your thoughts on returning different error codes? For instance, I can see utility in differentiating between hard and transient errors. I could loop on sending a message until success. If the send is failing because of a config problem, then it will never succeed (and loop needlessly).

I don't mind working on a PR for it, just wanted to know your (@Red5d's) opinion before going down this road. If generally "yes", could you help enumerate what error codes would make sense?

  • 1-99: return codes passed through from curl (e.g., 6 is "couldn't resolve host", 7 is "failed to connect to host", both possibly transient errors)
  • 200: PB authentication error
  • 201: PB device error (not found or already exists?)
  • 202: PB object-not-found error
  • 203: PB other error
  • 210: dependency error (hard fail)
  • 211: configuration error
  • 212: URL or email format error
  • 213: file error (perms or not found)

Since the current method is to always return "1" if there's an error, I don't see backward compatibility being an issue here. Since man curl only lists up to 90 at the moment, it should be easy to start at 100; I chose 200 only to preserve plenty of room for curl's error-code expansion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions