Convert all filesystem error types into the same Error struct
This commit is contained in:
@@ -11,9 +11,9 @@ func TestFilesystem_PathResolutionError(t *testing.T) {
|
||||
g.Describe("NewBadPathResolutionError", func() {
|
||||
g.It("is can detect itself as an error correctly", func() {
|
||||
err := NewBadPathResolution("foo", "bar")
|
||||
g.Assert(IsBadPathResolutionError(err)).IsTrue()
|
||||
g.Assert(IsErrorCode(err, ErrCodePathResolution)).IsTrue()
|
||||
g.Assert(err.Error()).Equal("filesystem: server path [foo] resolves to a location outside the server root: bar")
|
||||
g.Assert(IsBadPathResolutionError(ErrIsDirectory)).IsFalse()
|
||||
g.Assert(IsErrorCode(&Error{code: ErrCodeIsDirectory}, ErrCodePathResolution)).IsFalse()
|
||||
})
|
||||
|
||||
g.It("returns <empty> if no destination path is provided", func() {
|
||||
|
||||
Reference in New Issue
Block a user