diff options
author | 2022-05-08 19:49:45 +0200 | |
---|---|---|
committer | 2022-05-08 18:49:45 +0100 | |
commit | 5004e0a9da665ccc0e18cd4075ee636641b71f0a (patch) | |
tree | b7c8269b954ced61afa9fffd7305bd88acca6f8e /vendor/codeberg.org/gruf/go-errors/v2/error.go | |
parent | [bugfix] Fix existing bio text showing as HTML (#531) (diff) | |
download | gotosocial-5004e0a9da665ccc0e18cd4075ee636641b71f0a.tar.xz |
[bugfix] Fix remote media pruning failing if media already gone (#548)
* 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>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-errors/v2/error.go')
-rw-r--r-- | vendor/codeberg.org/gruf/go-errors/v2/error.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/codeberg.org/gruf/go-errors/v2/error.go b/vendor/codeberg.org/gruf/go-errors/v2/error.go new file mode 100644 index 000000000..ed1217a29 --- /dev/null +++ b/vendor/codeberg.org/gruf/go-errors/v2/error.go @@ -0,0 +1,35 @@ +//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 +} |