Repository navigation
Expand file tree
/
Copy patherrors.go
More file actions
90 lines (63 loc) · 3.67 KB
/
Copy patherrors.go
File metadata and controls
90 lines (63 loc) · 3.67 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
package herald
import (
"errors"
"github.com/xraph/herald/credential"
"github.com/xraph/herald/store"
"github.com/xraph/herald/template"
)
// Sentinel errors returned by Herald operations.
var (
// ErrNoStore is returned when a Herald instance is created without a store.
ErrNoStore = errors.New("herald: store is required")
// ErrProviderNotFound is returned when a provider cannot be found.
ErrProviderNotFound = store.ErrProviderNotFound
// ErrProviderDisabled is returned when the resolved provider is disabled.
ErrProviderDisabled = errors.New("herald: provider is disabled")
// ErrNoProviderConfigured is returned when no provider is configured for the requested channel.
ErrNoProviderConfigured = errors.New("herald: no provider configured for channel")
// ErrDriverNotFound is returned when a driver is not registered.
ErrDriverNotFound = errors.New("herald: driver not found")
// ErrTemplateNotFound is returned when a template cannot be found.
ErrTemplateNotFound = store.ErrTemplateNotFound
// ErrVersionNotFound is returned when a template version cannot be found.
ErrVersionNotFound = store.ErrVersionNotFound
// ErrTemplateDisabled is returned when the resolved template is disabled.
ErrTemplateDisabled = errors.New("herald: template is disabled")
// ErrNoVersionForLocale is returned when no template version matches the requested locale.
ErrNoVersionForLocale = template.ErrNoVersionForLocale
// ErrTemplateRenderFailed is returned when template rendering fails.
ErrTemplateRenderFailed = template.ErrTemplateRenderFailed
// ErrMissingRequiredVariable is returned when a required template variable is not provided.
ErrMissingRequiredVariable = template.ErrMissingRequiredVariable
// ErrMessageNotFound is returned when a message cannot be found.
ErrMessageNotFound = store.ErrMessageNotFound
// ErrInboxNotFound is returned when an in-app notification cannot be found.
ErrInboxNotFound = store.ErrNotificationNotFound
// ErrPreferenceNotFound is returned when user preferences cannot be found.
ErrPreferenceNotFound = store.ErrPreferenceNotFound
// ErrScopedConfigNotFound is returned when no scoped config is found.
ErrScopedConfigNotFound = store.ErrScopedConfigNotFound
// ErrInvalidChannel is returned when an unsupported channel type is specified.
ErrInvalidChannel = errors.New("herald: invalid channel type")
// ErrSendFailed is returned when notification delivery fails.
ErrSendFailed = errors.New("herald: send failed")
// ErrOptedOut is returned when the user has opted out of this notification type.
ErrOptedOut = errors.New("herald: user opted out")
// ErrStoreClosed is returned when a store operation is attempted after close.
ErrStoreClosed = errors.New("herald: store is closed")
// ErrMigrationFailed is returned when a database migration fails.
ErrMigrationFailed = errors.New("herald: migration failed")
// ErrDuplicateSlug is returned when a template slug+channel+app combination already exists.
ErrDuplicateSlug = store.ErrDuplicateSlug
// ErrDuplicateLocale is returned when a template version for the same locale already exists.
ErrDuplicateLocale = store.ErrDuplicateLocale
// ErrInvalidProvider wraps a provider that failed validation. The message
// names the problem and never a credential value.
ErrInvalidProvider = errors.New("herald: invalid provider")
// ErrNoCredentialKey is returned by operations that need a credential key
// when none is configured.
ErrNoCredentialKey = errors.New("herald: no credential key is configured")
// ErrCredentialKeyUnavailable means a credential was encrypted under a key
// that isn't configured. The message names the key ID.
ErrCredentialKeyUnavailable = credential.ErrKeyUnavailable
)