Class CannotResolveConcreteDerivedType
- Namespace
- Cratis.Arc.MongoDB
- Assembly
- Cratis.Arc.MongoDB.dll
Exception that gets thrown when a polymorphic value cannot be resolved to a concrete (instantiable) derived type during BSON deserialization.
public class CannotResolveConcreteDerivedType : Exception, ISerializable
- Inheritance
-
CannotResolveConcreteDerivedType
- Implements
- Inherited Members
- Extension Methods
Remarks
Returning a non-instantiable nominal type (an interface or abstract class) from the discriminator convention
makes MongoDB's DiscriminatedInterfaceSerializer look the same serializer up again and re-enter
resolution on the same bytes — an unbounded recursion that overflows the stack and terminates the process.
Failing loudly and catchably instead keeps the failure contained to the query that hit it.
Constructors
CannotResolveConcreteDerivedType(Type, string?)
Exception that gets thrown when a polymorphic value cannot be resolved to a concrete (instantiable) derived type during BSON deserialization.
public CannotResolveConcreteDerivedType(Type nominalType, string? discriminator)
Parameters
nominalTypeTypeThe nominal type being deserialized.
discriminatorstringThe discriminator value read from the document, if any.
Remarks
Returning a non-instantiable nominal type (an interface or abstract class) from the discriminator convention
makes MongoDB's DiscriminatedInterfaceSerializer look the same serializer up again and re-enter
resolution on the same bytes — an unbounded recursion that overflows the stack and terminates the process.
Failing loudly and catchably instead keeps the failure contained to the query that hit it.