IIQ Plugin Rest API error handling

Is there a way to configure the plugin REST API calls so that they do not redirect to a friendly exception page? I’d like my code to see the actual error code and switch appropriately.

It appears that when a plugin makes a REST API call to a method it has exposed, and something goes wrong with authentication, or some exception in code, that the request is redirected to the exception page which when served up has a status code of 200. While this makes sense for pages intended for a user’s consumption, I’d hope to have my calling code switch behavior on this error code.