I am currently working on Asp.net WebAPI2 Project. I am making a custom method for returning custom HttpStatusCode for error handling.
here's my code
public IHttpActionResult GetError(int errCode) {
int ErrCode = errCode * -1;
ResourceManager ResourceManager = new ResourceManager("PIJ.API.OWIN.Properties.Resources", Assembly.GetExecutingAssembly());
string ErrorMessage = ResourceManager.GetString("_" + ErrCode.ToString());
return Content((HttpStatusCode)ErrCode, new HttpError(ErrorMessage));
}
my current output is like this Output Screenshot
my question is. Is is possible to return only the HttpStatusCode, without the error Message ?
Thank you very much.