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

Revisit Error Types #48

Closed
taylortrimble opened this issue May 16, 2015 · 2 comments
Closed

Revisit Error Types #48

taylortrimble opened this issue May 16, 2015 · 2 comments

Comments

@taylortrimble
Copy link
Contributor

There were some comments from #41 that hinted we may wish to revisit error types. I don't have anything specific in mind today, but recommend we review error handling specifically after some of the more major API changes we're considering.

@nathany
Copy link
Contributor

nathany commented May 20, 2015

#3, #4, #30, #40

@nathany
Copy link
Contributor

nathany commented May 22, 2015

  • On develop I added ErrUnrecognizedErrorResponse to differentiate from the ErrUnknown that Apple could send.
  • ErrProcessing, etc. are just strings right now. Normally the Err prefix indicates an error type.
  • I would probably change ErrStr string to Err error.
  • The Error.Command should always be 8, and is therefore doesn't need to be stored.
// Error captures the error response read from Apple's Push Notification server.
type Error struct {
    Status     uint8
    Identifier uint32
    Err          error
}

There are also various low-level socket errors that Read() may return if we don't get an error from Apple:

  • There are a bunch of "tls: " errors during a handshake on the first read, but they are just error strings without exported Err constants to compare to.

  • There is some mention of EAGAIN or EOF errors.

  • There's also an io.ErrNoProgress error. I don't imagine we make many calls to Read though.

    when many calls to Read have failed to return any data or error, usually the sign of a broken io.Reader implementation

@taylortrimble taylortrimble closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants