Home

tmpl @71213332903e2651e8aaefae6b8c34909cc79519 - refs - log -
-
https://git.jolheiser.com/tmpl.git
Template automation
tmpl / registry / error.go
- raw
 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
package registry

import "fmt"

type ErrTemplateNotFound struct {
	Name string
}

func (e ErrTemplateNotFound) Error() string {
	return fmt.Sprintf("template not found for %s", e.Name)
}

func IsErrTemplateNotFound(err error) bool {
	_, ok := err.(ErrTemplateNotFound)
	return ok
}

type ErrSourceNotFound struct {
	Name string
}

func (e ErrSourceNotFound) Error() string {
	return fmt.Sprintf("Source not found for %s", e.Name)
}

func IsErrSourceNotFound(err error) bool {
	_, ok := err.(ErrSourceNotFound)
	return ok
}