mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-07-18 03:08:16 +00:00
5004e0a9da
* fix error check of prune to allow missing files * update go-store library, add test for pruning item with db entry but no file Signed-off-by: kim <grufwub@gmail.com> * remove now-unneccessary error check Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
36 lines
551 B
Go
36 lines
551 B
Go
//go:build !notrace
|
|
// +build !notrace
|
|
|
|
package errors
|
|
|
|
type errormsg struct {
|
|
msg string
|
|
wrap error
|
|
stack Callers
|
|
}
|
|
|
|
func create(msg string, wrap error) *errormsg {
|
|
return &errormsg{
|
|
msg: msg,
|
|
wrap: wrap,
|
|
stack: GetCallers(2, 10),
|
|
}
|
|
}
|
|
|
|
func (err *errormsg) Error() string {
|
|
return err.msg
|
|
}
|
|
|
|
func (err *errormsg) Is(target error) bool {
|
|
other, ok := target.(*errormsg)
|
|
return ok && (err.msg == other.msg)
|
|
}
|
|
|
|
func (err *errormsg) Unwrap() error {
|
|
return err.wrap
|
|
}
|
|
|
|
func (err *errormsg) Stacktrace() Callers {
|
|
return err.stack
|
|
}
|