How to parse AutoMapper exceptions for error logs table? #3663
frankhaugen
started this conversation in
NA
Replies: 1 comment
-
You should look at how the error message is composed. And write some tests :) These are internal details that we're not going to document. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry for a clumsy title, but it's descriptive.
I am mapping a single object/record at a time to ensure I get the exception, but exploring the AutoMapperMappingException type, it's a jungle of information.
What I want is a simple one row per property/field when something goes wrong, that can be customer readable. I would have expected there to be a ton of libraries to facilitate this, or some docs but I can't find anything.
Here's my little extension method to extract the exception:
here's how I map it to my internal entity, (or rather two of the lines referencing the type name works fine, but I want member/property names, and those examples only return "null"):
Beta Was this translation helpful? Give feedback.
All reactions