Results 1 to 2 of 2
  1. #1
    j_kathiresan is offline Member
    Join Date
    Feb 2008
    Rep Power

    Default Handling Exceptions in front end with respect to back-end code

    The following code handles both success and failure types.


    url: myAjax.ajaxurl,
    data: {action: 'submit_data', info: info},
    success: function(data) {
    successmessage = 'Data was succesfully captured';
    error: function(data) {
    successmessage = 'Error';

    Will all the error come to the error section....RuntimeException - i.e checked and non-checked exceptions......

    OR only exceptions will be caught and NOT ERRORS..In java we have both ERROR and EXCEPTION classes

    Would like to know what will happen ??

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Handling Exceptions in front end with respect to back-end code

    This has nothing to do with Java.
    The error and success callbacks are entirely based on what is returned from the server, so what response the server returns.
    A success is any 200 response, otherwise (I believe) it will fall into the error callback.

    So which one gets called will depend on how your server is set up to handle exceptions.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 9
    Last Post: 06-12-2014, 03:43 AM
  2. Replies: 1
    Last Post: 07-10-2012, 10:33 PM
  3. Replies: 0
    Last Post: 11-30-2011, 05:46 PM
  4. Data Exchange Format between Web Front End and Web Back End
    By jeanjiang in forum Reviews / Advertising
    Replies: 0
    Last Post: 06-25-2011, 01:37 PM
  5. Replies: 2
    Last Post: 02-04-2009, 02:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts