When using pojos strategy, there's an internal error while creating an error message #501
Closed
3 of 9 tasks
Labels
bug
Something isn't working
Is there an existing issue for this?
Describe the issue
When trying to convert from one type to another and the configuration is not complete, instead of throwing a meaningful error, the following error is thrown:
Models/DTOs/VMs
Mapping configuration
Steps to reproduce
The following code can help reproduce the problem.
Note this is copied from your examples, I intentionally removed the mapping for
fullName
and used a custom error handler hoping I will get the following message:The root cause seems to lie here:
mapper/packages/core/src/lib/utils/assert-unmapped-properties.ts
Line 45 in 85060cd
Basically it tries to do
where
identifier
is a Symbol and this fails withTypeError: Cannot convert a Symbol value to a string
Expected behavior
A proper error message should be passed to my error handler.
Note that by default if an error handler is not configured mapping errors are "swallowed" but in this case, the error is thrown before it gets to the error handler
Screenshots
No response
Minimum reproduction code
No response
Package
@automapper/core
@automapper/classes
@automapper/nestjs
@automapper/pojos
@automapper/mikro
@automapper/sequelize
Other package and its version
No response
AutoMapper version
8.7.5
Additional context
No response
The text was updated successfully, but these errors were encountered: