-
-
Notifications
You must be signed in to change notification settings - Fork 230
Expand file tree
/
Copy pathFunction.cs
More file actions
22 lines (19 loc) · 917 Bytes
/
Function.cs
File metadata and controls
22 lines (19 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using Google.Cloud.Functions.Framework;
using Google.Cloud.Functions.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
// *********************************************************************************************
// NOTE: to run this sample you'll need to specify a Sentry DSN, either by configuring it in the
// appsettings.json file or by setting the SENTRY_DSN environment variable.
// *********************************************************************************************
[assembly: FunctionsStartup(typeof(SentryStartup))]
public class Function : IHttpFunction
{
private readonly ILogger<Function> _logger;
public Function(ILogger<Function> logger) => _logger = logger;
public Task HandleAsync(HttpContext context)
{
_logger.LogInformation("Useful info that is added to the breadcrumb list.");
throw new Exception("Bad function");
}
}