Hello. In examples from the custom code we can see this:
return new HttpResponseObject(HTTP_STATUS_SUCCESS, response);
This is the natural way to end a Custom Code. However in my case I would like to force an exception of the execution of the custom code if something went wrong, because I don't want to treat different situations in client. In the client I want to have two situations - SUCCESS or EXCEPTION.
Otherwise speaking, in my client it always expects a successful response. If something is wrong it expects an exception. But how could I trigger an Custom Code exception. Would that work?
return new HttpResponseObject(500, null);