decode method

V decode(
  1. Object? raw
)

Decodes raw with codec, wrapping any failure in a SchemaReadException that names this field.

Implementation

V decode(Object? raw) {
  try {
    return codec.decode(raw);
  } on SchemaReadException {
    rethrow;
  } catch (error) {
    throw SchemaReadException(fieldName: name, expectedType: V, actualValue: raw, cause: error);
  }
}