in src/Google.Cloud.Functions.Framework/CloudEventAdapterTData.cs [36:54]
public CloudEventAdapter(ICloudEventFunction<TData> function, ILogger<CloudEventAdapter<TData>> logger) =>
throw new InvalidOperationException(
"No CloudEventFormatter has been configured for the CloudEvent function. " +
"The Functions Framework hosting will provide an event formatter if the target " +
"data type is decorated with CloudEventFormatterAttribute; otherwise, the formatter " +
"should be configured via dependency injection.");
/// <summary>
/// Constructs a new instance based on the given CloudEvent Function.
/// </summary>
/// <param name="function">The CloudEvent Function to invoke.</param>
/// <param name="formatter">The CloudEvent formatter to use to deserialize the CloudEvent.</param>
/// <param name="logger">The logger to use to report errors.</param>
public CloudEventAdapter(ICloudEventFunction<TData> function, CloudEventFormatter formatter, ILogger<CloudEventAdapter<TData>> logger)
{
_function = Preconditions.CheckNotNull(function, nameof(function));
_formatter = Preconditions.CheckNotNull(formatter, nameof(formatter));
_logger = Preconditions.CheckNotNull(logger, nameof(logger));
}