Search Posts

Category: error-handling

[SOLVED]Json decode "Trying to get property of non-object" ERROR

After some hours dealing with it, i’ll be specific. I’m trying to pass data from a table on angular (view), to the controller, the controller call to a factory and it last make an http request to a .php file. It isn’t so hard as it seems. This is the error i’m getting } Trying to get property of non-object on line 6 It’s my .php file (to get a simple select query) // Including […]

In AngularJS, does every then require a catch?

I am performing multiple ajax calls, and I want to complete all of them before I display my form. If there is an error, I want to stop processing and just show the first error encountered. I have googled a lot of articles, including on StackOverflow, that show how to chain the then statements. But it appears I have to attach a catch to each then, otherwise only errors in the last statement are caught. […]

ui-router "The transition was ignored" during state transition

I want to set a general error handler for certain states of my app like main.* and want to redirect user to a general error page if any of state resolves are failed. I set the following error handler: $transitions.onError({to: “main.*”}, function (trans) { $state.go(“transition-error”) }); but If I click on a link say <a ui-sref=”main.profile”> profile </a>, and transition occurs successfully and I click on that link for the second time, my error handler […]

How to handle HTTP error in the client side?

What is the best way to handle HTTP errors (404, 503, etc.) when submitting a crucial data on the server? Possible solutions I came up with: having the data stored in the session for later submission (data is lost if session expired) have the data downloaded by the user and manually submit it again is it possible to store the data as cookie? Source: AngularJS