mirror of
https://github.com/distribution/distribution.git
synced 2025-09-13 13:49:00 +00:00
refactor: Storage driver errors
Small refactoring of storagedriver errors. We change the Enclosed field to Detail and make sure Errors get properly serialized to JSON. We also add tests. Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
@@ -79,12 +79,10 @@ func (base *Base) setDriverName(e error) error {
|
||||
actual.DriverName = base.StorageDriver.Name()
|
||||
return actual
|
||||
default:
|
||||
storageError := storagedriver.Error{
|
||||
return storagedriver.Error{
|
||||
DriverName: base.StorageDriver.Name(),
|
||||
Enclosed: e,
|
||||
Detail: e,
|
||||
}
|
||||
|
||||
return storageError
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user