SWC-1916: send error back to browser in a standard way