fix(blogo,core): make error not pointer to better follow std
This commit is contained in:
@@ -29,25 +29,37 @@ type ServeError struct {
|
|||||||
Err error
|
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)
|
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 {
|
type SourceError struct {
|
||||||
Sourcer plugin.Sourcer
|
Sourcer plugin.Sourcer
|
||||||
Err error
|
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())
|
return fmt.Sprintf("failed to source files with sourcer %q", e.Sourcer.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e SourceError) Unwrap() error {
|
||||||
|
return e.Err
|
||||||
|
}
|
||||||
|
|
||||||
type RenderError struct {
|
type RenderError struct {
|
||||||
Renderer plugin.Renderer
|
Renderer plugin.Renderer
|
||||||
File fs.File
|
File fs.File
|
||||||
Err error
|
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())
|
return fmt.Sprintf("failed to source files with renderer %q", e.Renderer.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e RenderError) Unwrap() error {
|
||||||
|
return e.Err
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user