Skip to content

Commit

Permalink
Fix error where PR broke global error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkneen committed Apr 12, 2017
1 parent 235a044 commit 110848c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reste",
"version": "1.4.6",
"version": "1.4.7",
"description": "A JavaScript REST / API helper for Titanium with Alloy Models/Collections support",
"titaniumManifest": {
"guid": "afafe8b0-b93b-771c-a9e5-4e71db81b9ff"
Expand Down
11 changes: 5 additions & 6 deletions reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,15 @@ var main = function() {
}

// if we have an onError method, use it
if (onError) {
if (config.onError) {
// if we have a global onError, we'll pass it on too do we can still use it locally if we want to
if (config.onError) {
if (onError) {
onError(error, retry, config.onError);
} else {
onError(error, retry);
config.onError(error, retry);
}
} else if (config.onError) {
// otherwise fallback to the one specified in config
config.onError(error, retry);
} else if (onError) {
onError(error, retry);
} else if (onLoad) {
// otherwise revert to the onLoad callback
onLoad(error, retry);
Expand Down

0 comments on commit 110848c

Please sign in to comment.