forked from G-Core/gcorelabscloud-go
/
errors.go
41 lines (31 loc) · 791 Bytes
/
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
package stacks
import (
"fmt"
gcorecloud "github.com/alexandrpaliy/gcorelabscloud-go"
)
type ErrInvalidEnvironment struct {
gcorecloud.BaseError
Section string
}
func (e ErrInvalidEnvironment) Error() string {
return fmt.Sprintf("environment has wrong section: %s", e.Section)
}
type ErrInvalidDataFormat struct {
gcorecloud.BaseError
}
func (e ErrInvalidDataFormat) Error() string {
return "data in neither json nor yaml format"
}
type ErrInvalidTemplateFormatVersion struct {
gcorecloud.BaseError
Version string
}
func (e ErrInvalidTemplateFormatVersion) Error() string {
return "template format version not found"
}
type ErrTemplateRequired struct {
gcorecloud.BaseError
}
func (e ErrTemplateRequired) Error() string {
return "template required for this function"
}