Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
handling 500 error
26/04/2010
16:04
Avatar
gowger
Member
Members
Forum Posts: 6
Member Since:
31/03/2010
sp_UserOfflineSmall Offline

Hi there,

I'm trying to get the loadError event to fire so that I can redirect the user to the my login page. When I make the server return a 500 error then I expected the event to be triggered but it doesn't.

I'm setting the loadError function like this:

    loadError: function(xhr, textStatus, errorThrown) {
        alert("Ajax Error occurred\n"
                + "\nstatus is: " + xhr.status
                + "\ntextStatus is: " + textStatus
                + "\nerrorThrown is: " + errorThrown
                );
    },

If I use the following jquery ajax call then I do get the error event and can display the error status.   

jQuery.ajax({
        type: "POST",
        url: "http://localhost:8080/webauth/.....",
        dataType:"json",
        error:function (xhr, ajaxOptions, thrownError) {
            alert("Ajax Error occurred\n"
                    + "\nstatus is: " + xhr.status
                    + "\nthrownError is: " + thrownError
                    + "\najaxOptions is: " + ajaxOptions
                    );
        }
    });

any idea what I need to do to trigger the loadError event? 

Thanks in advance!

26/04/2010
19:48
Avatar
gowger
Member
Members
Forum Posts: 6
Member Since:
31/03/2010
sp_UserOfflineSmall Offline

In the struts plugin that I am using then I found that I had to use

onErrorTopics="error"

and then I have the function to redirect to the logout page like this:

$.subscribe('error', function(event, data) {
    $(location).attr('href',"logoutAction");
})

It is the struts plugin which appears to have been getting in the way of the loadComplete as well as a few of the other events, and attempting to override the defaults doesn't help.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
68 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information