Skip to content

Commit

Permalink
Added basic HTTP-level error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
VineetReynolds committed Feb 8, 2013
1 parent 95390d2 commit ee6acbc
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ function New${entityName}Controller($scope,$location,${entityName}Resource
var fragments = locationHeader.split('/');
var id = fragments[fragments.length -1];
$location.path('/${entityName}s/edit/' + id);
}, function() {
// TODO: Fix this through a HTTP interceptor that updates the view.
// We won't update the view here since controllers do not update views.
alert("Oops! Something broke. Retry, or cancel and start afresh.");
});
};

Expand Down Expand Up @@ -169,6 +173,8 @@ function Edit${entityName}Controller($scope,$routeParams,$location,${entityName}
});
</#if>
</#list>
}, function() {
$location.path("/${entityName}s");
});
};

Expand Down

0 comments on commit ee6acbc

Please sign in to comment.