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

Update APIError struct to use new NullAPIErrorObject type for safety #272

Merged
merged 1 commit into from
Feb 13, 2021

Commits on Feb 12, 2021

  1. Update APIError struct to use new NullAPIErrorObject type for safety

    I discovered that my initial implementation of the APIError type's NotFound()
    method had the potential for triggering a nil pointer dereference panic, which
    wouldn't be a great experience for someone dealing with PagerDuty code.
    
    I provided a fix in #271, but in doing so I remembered this pattern from the
    `database/sql` package and decided that, while not as nice to use, it was a much
    safer API to reduce the chances of the consumer accidentally triggering a panic
    in their program.
    
    Since we've yet to release v1.4.0 (i.e., the new APIError type still hasn't been
    released) we can still change this without breaking API compatibility
    guarantees.
    theckman committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    5e16250 View commit details
    Browse the repository at this point in the history