convert exception to HTTP errors