tryJsonDecode function

dynamic tryJsonDecode(
  1. BaseResponse response,
  2. String body
)

Implementation

dynamic tryJsonDecode(
  final BaseResponse response,
  final String body,
) {
  try {
    return jsonDecode(body);
  } on FormatException {
    throw DataNotFoundException(
      'No body exists in response.',
      response,
    );
  }
}