$.ajax success/error confusion!

$.ajax success/error confusion!

Hi all,
I need a little help with an ajax call.  This is what I have at the moment:
  1. function importPages(category)
  2. {
  3. var uri = getUrl();
  4. $.ajax({
  5. type: 'get',
  6. url: uri,
  7. dataType: 'html',
  8. async: false,
  9. error: function(){
  10. importPagesLocal(category);
  11. },
  12. success: function(data) {;
  13. addPage(category,data);
  14. $("#"+category+"-mobile").html("<br/>"+data);
  15. }
  16. });
  17. }
Now; this works fine when the url is available, the success function runs as expected. When the url is unavailable, the error function runs as it should but the success function runs as well.  Have I misunderstood the success option? Is there a way of calling error on error and success on success?

Thanks for any help

Paul