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

Initial pass at Error classes #49

Closed
wants to merge 5 commits into from
Closed

Conversation

npauzenga
Copy link
Owner

Hey @enriikke!

I'm just getting a basic framework together for Error classes. I don't know exactly what I'd like them to take as arguments. InvalidParamsError.new(params) or similar could be useful for a more detailed description but I'm not sure.

The Error.code is also currently separate from the HTTP status the controller will return and that's a little confusing. Perhaps I make the code the HTTP status code and do something like status: result.errors.first.code ... though that's pretty ugly.

Thoughts?

I’m starting with InvalidParamsError in the UpdateUser interactor. The
class will eventually need to be more dynamic but if the pattern works
we can implement it everywhere.
@enriikke
Copy link
Collaborator

This is a great start @npauzenga!!! 👍 :shipit:

It's hard for me to say because I'm also in the process of defining this flow myself. The main thing you have to keep in mind is consistency in my opinion. I agree with you that result.errors.first.code is not very elegant but I also don't have a good answer for this. We just need to keep trying and experimenting as the API grows.

@npauzenga
Copy link
Owner Author

closed in favor of #95

@npauzenga npauzenga closed this Jan 25, 2016
@npauzenga npauzenga deleted the features/error-class branch January 30, 2016 17:20
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

Successfully merging this pull request may close these issues.

None yet

2 participants