Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

callback handler implementation #53

Open
natebrennand opened this issue Jul 15, 2014 · 5 comments
Open

callback handler implementation #53

natebrennand opened this issue Jul 15, 2014 · 5 comments
Labels

Comments

@natebrennand
Copy link
Owner

So I've been trying to figure out what the best way to handle errors in the callback handlers, currently they're just ignored. There isn't really an accepted way of doing this based on the golang mailing list but one of the solutions is to return a struct that contains both an object and an error.

Any opposition to switching ours to that?

@chelpu
Copy link
Collaborator

chelpu commented Jul 15, 2014

Let's do it

@natebrennand
Copy link
Owner Author

k, will switch to return something along these lines:

type CallbackResponse struct {
    Callback
    Err error
}

If we embed it then it's still accessible with a single dot notation access

@natebrennand
Copy link
Owner Author

I thought about it more and I'm less sure that it's useful.
There are 2 core reasons that an error would occur.

  1. Twilio messes up their encoding. Everything is fucked no matter what at this point. You can't re-request a callback to be sent
  2. Someone is accidentally sending invalid requests to the endpoint

I think we should just import log and leave a message if it's every invalid

@chelpu
Copy link
Collaborator

chelpu commented Jul 26, 2014

Fine by me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants