-
Notifications
You must be signed in to change notification settings - Fork 278
/
errors.go
48 lines (40 loc) · 1.35 KB
/
errors.go
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
package app
import (
"encr.dev/pkg/errors"
)
const (
serviceHelp = "For more information on services and how to define them, see https://encore.dev/docs/primitives/services-and-apis"
)
var (
errRange = errors.Range(
"app",
"",
)
errServiceContainedWitinAnother = errRange.Newf(
"Service contained within another service",
"The service %s was found within the service %s. Encore does not allow services to be nested.",
errors.WithDetails(serviceHelp),
)
errDuplicateServiceNames = errRange.Newf(
"Duplicate service names",
"Two services were found with the same name %q, services must have unique names.",
)
errNoServiceFound = errRange.Newf(
"No service found",
"No service was found for package %q.",
errors.MarkAsInternalError(),
)
errResourceDefinedOutsideOfService = errRange.New(
"Resource defined outside of service",
"Resources can only be defined within a service.",
)
errETPackageUsedOutsideOfTestFile = errRange.New(
"Invalid use of encore.dev/et",
"Encore's test packages can only be used inside tests and cannot otherwise be imported.",
)
errResourceUsedOutsideService = errRange.New(
"Invalid resource usage",
"Infrastructure resources can only be referenced within services.",
errors.WithDetails("To use infrastructure resources outside services, instead pass a reference to the resource into the library."),
)
)