mirror of
				https://github.com/Theodor-Springmann-Stiftung/musenalm.git
				synced 2025-10-30 17:55:31 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			533 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			533 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 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
 | |
| }
 | 
