Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Init = sync.OnceValue(func() error { cfg, err := gcp.LoadConfig() if err != nil { return fmt.Errorf("load config: %w", err) } errorClient, err = errorreporting.NewClient(context.Background(), cfg.ProjectID, errorreporting.Config{ ServiceName: cfg.Service, ServiceVersion: config.GetVersion(), OnError: func(err error) { slog.Error("Create new error client failed.", slog.Any("error", err)) }, }) if err != nil { return fmt.Errorf("load error reporting client: %w", err) } slog.Info("GCP error client created.") return nil })
Functions ¶
func ReportError ¶
ReportError reports an error to the Cloud Console. The error client auto populates the error context of the error. For more details about the context see: https://cloud.google.com/error-reporting/reference/rest/v1beta1/ErrorContext.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.