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

Friendly Errors #101

Closed
wants to merge 1 commit into from
Closed

Friendly Errors #101

wants to merge 1 commit into from

Conversation

nikz
Copy link
Contributor

@nikz nikz commented Oct 23, 2015

Hopefully I filled out everything correctly.

Thanks for looking at this! 😎

Here's a wee "friendly error" preview:

@nikz nikz changed the title First cut of Friendly Errors RFC Friendly Errors Oct 23, 2015
@alexspeller
Copy link
Contributor

👍

@mmun mmun added the T-ember-data RFCs that impact the ember-data library label Oct 23, 2015
@tim-evans
Copy link

It would be neat to provide something like Rail's filter_parameters if requests are shown.

@jcope2013
Copy link

a start emberjs/data#3862

@bmac
Copy link
Member

bmac commented Nov 4, 2015

Hi @nikz. I like this rfc a lot. Would you like to open a pr on the Ember Data repo where we can iterate on the implementation of the friendly-error-adapter code?

export default ActiveModelAdapter.extend({

ajax(url, method) {
this.lastRequest = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This technique may not work with multiple concurrent ajax requests. Instead I suspect we will need to pass the request or errorMessage as an argument to handleResponse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, mostly a hack to avoid trying to drop too deeply into the ember-data code. Definitely better ways to do it!

@nikz
Copy link
Contributor Author

nikz commented Nov 5, 2015

@bmac awesome! I will do so over the weekend and cc you :)

@fivetanley
Copy link
Member

Assigned an RFC number and merged in 6157685

@nikz's PR in emberjs/data#3930 was the implementation. Thank you so much!

@fivetanley fivetanley closed this Jan 6, 2016
@grapho
Copy link

grapho commented Jan 6, 2016

I really like the idea of this RFC. However I also hold out hope that an AdapterError could hold an actual data payload.. for those of us that might receive an array of errors or a hash of error parameters? rather than (read: in addition too) just a serialized string of info?

@nikz
Copy link
Contributor Author

nikz commented Jan 6, 2016

@grapho Hiya! Remember this is just the default handler if you haven't specified anything else, mostly for debugging and error tracking.

If you use a blob of JSON then that'll be spit out, or if you're looking for more model validation things then a JSON API "errors" payload would work best.

@grapho
Copy link

grapho commented Jan 6, 2016

@nikz yeah oops, i momentarily forgot that error payload can already get passed in... just ignore me ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-ember-data RFCs that impact the ember-data library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants