...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package errors
17
18 type NoSuchTemplateError struct {
19 Op string
20 Err error
21
22 WorkflowName string
23 TemplateName string
24 AllAvailableTemplates []string
25 }
26
27 func (e *NoSuchTemplateError) Error() string {
28 return toJsonOrFallbackToError(e)
29 }
30
31 func (e *NoSuchTemplateError) Unwrap() error {
32 return e.Err
33 }
34
35 func NewNoSuchTemplateError(op, workflowName, templateName string) *NoSuchTemplateError {
36 return &NoSuchTemplateError{
37 Op: op,
38 Err: ErrNoSuchTemplate,
39 WorkflowName: workflowName,
40 TemplateName: templateName,
41 }
42 }
43
44 func NewNoSuchTemplateErrorInTemplates(op, templateName string, allAvailableTemplates []string) *NoSuchTemplateError {
45 return &NoSuchTemplateError{
46 Op: op,
47 Err: ErrNoSuchTemplate,
48 TemplateName: templateName,
49 AllAvailableTemplates: allAvailableTemplates,
50 }
51 }
52