Debian Codegraph @

pkg/services/incident/pagerduty/errors.go

raw
1 package pagerduty
2
3 import "errors"
4
5 var (
6 // errInvalidIntegrationKey is returned when the integration key format is invalid.
7 errInvalidIntegrationKey = errors.New(
8 "invalid integration key format: must be a 32-character hexadecimal string",
9 )
10 // errMissingIntegrationKey is returned when the integration key is missing from the URL path.
11 errMissingIntegrationKey = errors.New(
12 "integration key is missing from URL path",
13 )
14
15 // errInvalidContextFormat is returned when a context string does not match the expected 'type:value' format.
16 errInvalidContextFormat = errors.New(
17 "invalid context format, expected 'type:value'",
18 )
19
20 // errEmptyContextTypeOrValue is returned when a context type or value is empty.
21 errEmptyContextTypeOrValue = errors.New(
22 "invalid context format, type and value cannot be empty",
23 )
24
25 // errInvalidSeverity is returned when the severity value is not one of the allowed values.
26 errInvalidSeverity = errors.New(
27 "invalid severity: must be one of 'critical', 'error', 'warning', or 'info'",
28 )
29
30 // errInvalidEventAction is returned when the event action is not one of the allowed values.
31 errInvalidEventAction = errors.New(
32 "invalid event action: must be one of 'trigger', 'acknowledge', or 'resolve'",
33 )
34
35 // errInvalidContextType is returned when a context type is not one of the allowed values for JSON format.
36 errInvalidContextType = errors.New(
37 "invalid context type: must be one of 'link' or 'image'",
38 )
39
40 // errMissingHrefForLinkContext is returned when a link context is missing the href field.
41 errMissingHrefForLinkContext = errors.New("missing href for link context")
42
43 // errMissingSrcForImageContext is returned when an image context is missing the src field.
44 errMissingSrcForImageContext = errors.New("missing src for image context")
45
46 // errServiceNotInitialized is returned when the service has not been properly initialized.
47 errServiceNotInitialized = errors.New("service not properly initialized: httpClient is nil")
48
49 // errPagerDutyNotificationFailed is returned when PagerDuty returns a non-2xx status code.
50 errPagerDutyNotificationFailed = errors.New("PagerDuty notification failed")
51 )