File: teams_errors.go

package info (click to toggle)
golang-github-nicholas-fedor-shoutrrr 0.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,432 kB
  • sloc: sh: 74; makefile: 5
file content (50 lines) | stat: -rw-r--r-- 2,046 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
package teams

import "errors"

// Error variables for the Teams package.
var (
	// ErrInvalidWebhookFormat indicates the webhook URL doesn't contain the organization domain.
	ErrInvalidWebhookFormat = errors.New(
		"invalid webhook URL format - must contain organization domain",
	)

	// ErrMissingHostParameter indicates the required host parameter is missing.
	ErrMissingHostParameter = errors.New(
		"missing required host parameter (organization.webhook.office.com)",
	)

	// ErrMissingExtraIDComponent indicates the URL is missing the extraId component.
	ErrMissingExtraIDComponent = errors.New("invalid URL format: missing extraId component")

	// ErrMissingHost indicates the host is not specified in the configuration.
	ErrMissingHost = errors.New("host is required but not specified in the configuration")

	// ErrSetParameterFailed indicates failure to set a configuration parameter.
	ErrSetParameterFailed = errors.New("failed to set configuration parameter")

	// ErrSendFailedStatus indicates an unexpected status code in the response.
	ErrSendFailedStatus = errors.New(
		"failed to send notification to teams, response status code unexpected",
	)

	// ErrSendFailed indicates a general failure in sending the notification.
	ErrSendFailed = errors.New("an error occurred while sending notification to teams")

	// ErrInvalidWebhookURL indicates the webhook URL format is invalid.
	ErrInvalidWebhookURL = errors.New("invalid webhook URL format")

	// ErrInvalidHostFormat indicates the host format is invalid.
	ErrInvalidHostFormat = errors.New("invalid host format")

	// ErrInvalidWebhookComponents indicates a mismatch in expected webhook URL components.
	ErrInvalidWebhookComponents = errors.New(
		"invalid webhook URL format: expected component count mismatch",
	)

	// ErrInvalidPartLength indicates a webhook component has an incorrect length.
	ErrInvalidPartLength = errors.New("invalid webhook part length")

	// ErrMissingExtraID indicates the extraID is missing.
	ErrMissingExtraID = errors.New("extraID is required")
)