How can I return HttpError
(own, pretty formatted, error message for front-end) then I use handy IHttpActionResult
?
public IHttpActionResult Delete(Guid id)
{
HttpError error = null;
// code omitted
if (error != null) {
// How can I achieve that?
return BadRequest(error);
}
return Ok();
}