One other thing to consider is: the consumer of this error is going to be the portal.  Depending on how it wants to use it, it *may* be neater to return JSON here also - but probably need to discuss this with whoever does the portal side of this integration.