fix(blogo,core): make error not pointer to better follow std

This commit is contained in:
Guz
2025-01-27 09:50:50 -03:00
parent af29d1adf3
commit 656bf92b4d

View File

@@ -29,25 +29,37 @@ type ServeError struct {
Err error
}
func (e *ServeError) Error() string {
func (e ServeError) Error() string {
return fmt.Sprintf("failed to serve file on path %q", e.Req.URL.Path)
}
func (e ServeError) Unwrap() error {
return e.Err
}
type SourceError struct {
Sourcer plugin.Sourcer
Err error
}
func (e *SourceError) Error() string {
func (e SourceError) Error() string {
return fmt.Sprintf("failed to source files with sourcer %q", e.Sourcer.Name())
}
func (e SourceError) Unwrap() error {
return e.Err
}
type RenderError struct {
Renderer plugin.Renderer
File fs.File
Err error
}
func (e *RenderError) Error() string {
func (e RenderError) Error() string {
return fmt.Sprintf("failed to source files with renderer %q", e.Renderer.Name())
}
func (e RenderError) Unwrap() error {
return e.Err
}