I am making an ajax call to my controller which is going to perform a long operation. The operation can fail for many reasons or succeed. If I want to force the failure code of my ajax call to execute ("error"), what do I need to do in my controller before returning? Just throw an exception?
Asked
Active
Viewed 391 times
1 Answers
0
Throwing an exception will lead to status code = 500 which will invoke the error handler, so it should be enough.

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928