mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 00:55:32 +00:00
added views
This commit is contained in:
21
templating/errors.go
Normal file
21
templating/errors.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package templating
|
||||
|
||||
import "errors"
|
||||
|
||||
var InvalidPathError = errors.New("Invalid path. Must be a directory.")
|
||||
var NoTemplateError = errors.New("No template found for this name")
|
||||
var InvalidTemplateError = errors.New("invalid template")
|
||||
var FileAccessError = errors.New("could not stat file or directory")
|
||||
|
||||
type FSError[T error] struct {
|
||||
File string
|
||||
Err T
|
||||
}
|
||||
|
||||
func NewError[T error](t T, file string) FSError[T] {
|
||||
return FSError[T]{File: file, Err: t}
|
||||
}
|
||||
|
||||
func (e FSError[T]) Error() string {
|
||||
return e.Err.Error() + ": " + e.File
|
||||
}
|
||||
Reference in New Issue
Block a user