Skip to content

Allow custom error codes with response.error #1955

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

Merged

Conversation

JeremyPlease
Copy link
Contributor

This fixes #1950.

Previously, response.error(...) from Cloud Code or before/after hooks would always use the error code "141" (Parse.Error.SCRIPT_FAILED).

This PR updates response.error to accept two parameters: an error code and a message. If no error code is passed then the standard "141" will be used.

@codecov-io
Copy link

codecov-io commented May 30, 2016

Current coverage is 91.84%

Merging #1955 into master will increase coverage by <.01%

@@             master      #1955   diff @@
==========================================
  Files            91         91          
  Lines          6394       6400     +6   
  Methods        1094       1094          
  Messages          0          0          
  Branches       1341       1343     +2   
==========================================
+ Hits           5872       5878     +6   
  Misses          522        522          
  Partials          0          0          

Powered by Codecov. Last updated by cd52580...bda37e8

@drew-gross
Copy link
Contributor

Awesome! I think this is a great idea. Because it includes a new public API, I'd like to see what other members of the community think before merging @TylerBrock @flovilmart @nlutsenko

@flovilmart
Copy link
Contributor

I'm happy with it!

@flovilmart
Copy link
Contributor

@TylerBrock any objection? Marking it as OK

@TylerBrock
Copy link
Contributor

Looks great to me. I like it.

@flovilmart flovilmart merged commit c6c9c97 into parse-community:master Jun 1, 2016
@flovilmart
Copy link
Contributor

Thanks for the PR!

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.

Customize the 141 error code returned by response.error()
5 participants