locked
Exception handling RRS feed

  • Question

  • User-1129879462 posted

    Is there a way to throw exception without breaking request pipeline, it looks throwing exception using throw new Exception or HttpResponseException causing the web page to break and page load animation keeps spinning forever.

    Thursday, March 2, 2017 3:51 PM

All replies

  • User527778624 posted

    Hi,

    AFAIK, exception thrown from webapi action method is considered 500 error at browser. (or whatever status code you send)

    Usually your Ajax code handles it by fail callback function.

    Try running your project in release mode (not debug).

    Thursday, March 2, 2017 5:43 PM
  • User-1129879462 posted

    It is the fail call back function causing this issue

    Any other way to handle this?

    Thursday, March 2, 2017 5:47 PM
  • User527778624 posted

    Hi,

    It is the fail call back function causing this issue

    In your fail callback, wrap everything in try-catch block and stop the page load animation.

    Thursday, March 2, 2017 5:57 PM