CloudEvent _decodeValidCloudEvent()

in functions_framework/lib/src/targets/cloud_event_targets.dart [100:114]


CloudEvent _decodeValidCloudEvent(
  Map<String, dynamic> map,
  String messageType,
) {
  try {
    return CloudEvent.fromJson(map);
  } catch (e, stackTrace) {
    throw BadRequestException(
      400,
      'Could not decode the request as a $messageType.',
      innerError: e,
      innerStack: stackTrace,
    );
  }
}