So I would like to get in console an json array with message, what would be equal with "Your direct manager have no account for your area."
But all I am getting is "Http failure response for https://localhost:44385/api/Option/Post: 500 Internal Server Error"
Note: When looking at dev tools -> network -> post -> response, then it shows html and css with right error message included, but no idea how to get it out from there.
Controller
[HttpPost("[action]")]
public void Post(Option option)
{
throw new NoBudgetAccountException();
}
Exception
[Serializable]
public class NoBudgetAccountException : Exception
{
public NoBudgetAccountException() : base("Your direct manager have no account for your area.")
{
}
}
Angular apiService
addOrUpdateOption(option: ITrainingOption): Observable<Response> {
return this.post<Response>("api/Option/Post", option);
}
Angular component
submitOption(option: ITrainingOption) {
this.apiService.addOrUpdateOption(option).subscribe(() => {
this.isAddOptionShown = false;
this.getHeadlines(this.selectedYear);
},
err => { console.log(err); });
}


HttporHttpClient?console.logget printed? You should be able to useconsole.log(err.error)to get the body