DSResponse failure does not send callback

in a custom operation,
if an exception was raised I want to set the DSResponse to failure,
and tell the client that an error has occurred.

but when I change the status of the response to failure the callback does not reach the DSCallback.

am I missing something?