By default, ActivityFeed catches all client-side exceptions and displays them as alerts.

activityFeed.api = new function () {
//...
    this.handleError = function (exception) {
        var errorText = "ERROR: status - " + exception.status 
                        + ", message: " + exception.statusText;
        alert(errorText);
    };
//...
};
To change this behaviour you could override handleError function of activityFeed.api object.

function showError(exception) {
  $("#dialog-error #errorCode").text(exception.status);
  $("#dialog-error #errorText").text(exception.statusText);
  $("#dialog-error").dialog("open");
}

activityFeed.api.handleError = function (exception) {
 if (exception.status == 401) {
   window.location = '<%= Page.ResolveUrl("~/Login.aspx") %>';
  }
  else {
    showError(exception);
  }
};
Note: Live example is available in source code.

Last edited Jul 16, 2012 at 11:14 AM by grzwie, version 1

Comments

No comments yet.