Help with Ajax and errors.

Help with Ajax and errors.

I have my ajax function working, but I need to handle to error cases, one is a timeout and the other is a 403 not authenticated. I am having trouble figuring this out, any tips on how to set this up? Can I have two error possibilities? Here is the function so far. Thanks!
  1. $('#container').html('<img src="loading.gif" />');
           
    var url = "proxy.php";
    var data = "?c=product&m=categories";

    $.ajax({
        type: 'POST',
        url: "proxy.php",
        data: url+data,
       
        success: function(data){
           
            $('#container').html(data);

        },
        dataType: 'html'
    });