ParseException class

Exception thrown when an illegal operation occurs during data parsing.

Typically thrown from a model's fromJson factory when deserialization fails. For error-type counterparts, see ParseError.

Example:

factory MyModel.fromJson(Map<String, dynamic> json) {
  final name = json['name'];
  if (name is! String) throw ParseException('Expected string for "name"');
  return MyModel(name: name);
}
Implemented types

Constructors

ParseException(String exception)

Properties

exception String
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited