SchemaReadException constructor
SchemaReadException({})
Implementation
SchemaReadException({
this.entity,
required this.fieldName,
required this.expectedType,
this.actualValue,
this.cause,
}) : super(
code: DatumExceptionCode.schemaMismatch,
message: 'Failed to read field "$fieldName"'
'${entity != null ? ' of $entity' : ''}: expected $expectedType, '
'got ${actualValue == null ? 'null' : '${actualValue.runtimeType} ($actualValue)'}'
'${cause != null ? ' — $cause' : ''}',
details: {
'field': fieldName,
'expectedType': expectedType.toString(),
if (entity != null) 'entity': entity,
if (actualValue != null) 'actualValue': actualValue.toString(),
if (cause != null) 'cause': cause.toString(),
},
);