[jQuery] Why do both ajaxError and ajaxSuccess fire if the request fails or is a success?

[jQuery] Why do both ajaxError and ajaxSuccess fire if the request fails or is a success?


I was wondering why this code was giving me the error _and_ parsing my
XML:
    function getXML () {
        $.ajax({
            dataType: "xml",
            error: errorMessage("The data could not be loaded."),
            success: function (msg){parseXML(msg);},
            timeout: 10000,
            url: xmlUrl
        });
    };
when I read (from John himself I believe) that both error and success
are fired if the request fails or is successful. Can somebody explain
the logic here? Have I just misunderstood something?
Also, is it possible to have the error message show only when the
request fails and success show only when the request works?
Cheers.