File: errors.go

package info (click to toggle)
golang-github-nicholas-fedor-shoutrrr 0.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,680 kB
  • sloc: sh: 74; makefile: 58
file content (51 lines) | stat: -rw-r--r-- 2,164 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package pagerduty

import "errors"

var (
	// errInvalidIntegrationKey is returned when the integration key format is invalid.
	errInvalidIntegrationKey = errors.New(
		"invalid integration key format: must be a 32-character hexadecimal string",
	)
	// errMissingIntegrationKey is returned when the integration key is missing from the URL path.
	errMissingIntegrationKey = errors.New(
		"integration key is missing from URL path",
	)

	// errInvalidContextFormat is returned when a context string does not match the expected 'type:value' format.
	errInvalidContextFormat = errors.New(
		"invalid context format, expected 'type:value'",
	)

	// errEmptyContextTypeOrValue is returned when a context type or value is empty.
	errEmptyContextTypeOrValue = errors.New(
		"invalid context format, type and value cannot be empty",
	)

	// errInvalidSeverity is returned when the severity value is not one of the allowed values.
	errInvalidSeverity = errors.New(
		"invalid severity: must be one of 'critical', 'error', 'warning', or 'info'",
	)

	// errInvalidEventAction is returned when the event action is not one of the allowed values.
	errInvalidEventAction = errors.New(
		"invalid event action: must be one of 'trigger', 'acknowledge', or 'resolve'",
	)

	// errInvalidContextType is returned when a context type is not one of the allowed values for JSON format.
	errInvalidContextType = errors.New(
		"invalid context type: must be one of 'link' or 'image'",
	)

	// errMissingHrefForLinkContext is returned when a link context is missing the href field.
	errMissingHrefForLinkContext = errors.New("missing href for link context")

	// errMissingSrcForImageContext is returned when an image context is missing the src field.
	errMissingSrcForImageContext = errors.New("missing src for image context")

	// errServiceNotInitialized is returned when the service has not been properly initialized.
	errServiceNotInitialized = errors.New("service not properly initialized: httpClient is nil")

	// errPagerDutyNotificationFailed is returned when PagerDuty returns a non-2xx status code.
	errPagerDutyNotificationFailed = errors.New("PagerDuty notification failed")
)