public Exception HandleException(Exception exception, Guid handlingInstanceId)
{
var error = this.FormatErrorMessage(exception, handlingInstanceId);
var result = new HttpError(error, exception)
{
StatusCode = this.statusCode
};
if (!string.IsNullOrEmpty(this.errorCode))
{
result.ErrorCode = this.errorCode;
}
return result;
}