message property

String get message

Implementation

String get message {
  final location = path.isEmpty
      ? '<root>'
      : path
          .map((s) => s is int ? '[$s]' : '.$s')
          .join()
          .replaceFirst('.', '');
  if (cause != null) return 'Cannot decode $expected at $location: $cause';
  if (_missing) {
    return 'Missing required field $location (expected $expected)';
  }
  return 'Expected $expected at $location, got ${actual.runtimeType}';
}