defaultNonJsonRefusal function

ArgumentError defaultNonJsonRefusal(
  1. String atomKey,
  2. String verb,
  3. List<NonJsonArgument> found
)

The refusal for an atom without its own NonJsonArgumentPolicy.

Implementation

ArgumentError defaultNonJsonRefusal(
  String atomKey,
  String verb,
  List<NonJsonArgument> found,
) {
  final first = found.first;
  return ArgumentError(
    '$atomKey.$verb: argument ${first.where} is ${first.kind}, which JSON '
    'cannot carry',
  );
}