adjust errors and logger (#10)
This commit is contained in:
23
internal/errors/os_errors.go
Normal file
23
internal/errors/os_errors.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package errors
|
||||
|
||||
import "net/http"
|
||||
|
||||
func OpenFileFailed(path string, cause error) *Error {
|
||||
return Newf(cause, http.StatusInternalServerError, "failed to open file: %s", path).WithStack()
|
||||
}
|
||||
|
||||
func StatFileFailed(path string, cause error) *Error {
|
||||
return Newf(cause, http.StatusInternalServerError, "failed to stat file: %s", path).WithStack()
|
||||
}
|
||||
|
||||
func ReadFileFailed(path string, cause error) *Error {
|
||||
return Newf(cause, http.StatusInternalServerError, "failed to read file: %s", path).WithStack()
|
||||
}
|
||||
|
||||
func IncompleteRead(cause error) *Error {
|
||||
return New(cause, http.StatusInternalServerError, "incomplete header read during decryption").WithStack()
|
||||
}
|
||||
|
||||
func WriteOutputFailed(cause error) *Error {
|
||||
return New(cause, http.StatusInternalServerError, "failed to write output").WithStack()
|
||||
}
|
||||
Reference in New Issue
Block a user