Error message contains inner error details.

Open
#473 2 comments 2 reactions 1 assignee View on GitHub

@xuzhg is already working on this.

Since Feb 8, 2022.

Assessment

This issue has not been assessed yet.

Description

investigated

Hi team,

I have a simple Odata powered api with a simple endpoint:

  • http://localhost:1059/api/students

when calling the endpoint with an invalid filter query (the enum param new is an invalid status value):
http://localhost:1059/ai/students?$filter= status eq 'new'

we receive a BadRequest with an adequate message:
"The query specified in the URI is not valid. The string 'new' is not a valid enumeration type constant."

all the above is great, except for one issue, the error response body contains an innererror field containing the details of the exception.

i will provide an example response in the first comment

Is there a way to hide this field from the response? as a customer shouldn't see it

Thanks.

Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OData/AspNetCoreOData

All issues in OData/AspNetCoreOData

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.