azurestore: Work around error being not comparable
This commit is contained in:
parent
e77cc64063
commit
7eae867ec1
|
@ -112,9 +112,13 @@ func (store AzureStore) GetUpload(ctx context.Context, id string) (handler.Uploa
|
||||||
}
|
}
|
||||||
|
|
||||||
offset, err := blockBlob.GetOffset(ctx)
|
offset, err := blockBlob.GetOffset(ctx)
|
||||||
if err != nil && err != handler.ErrNotFound {
|
if err != nil {
|
||||||
|
// Unpack the error and see if it is a handler.ErrNotFound by comparing the
|
||||||
|
// error code. If it matches, we ignore the error, otherwise we return the error.
|
||||||
|
if handlerErr, ok := err.(handler.Error); !ok || handlerErr.ErrorCode != handler.ErrNotFound.ErrorCode {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
info.Offset = offset
|
info.Offset = offset
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ package handler
|
||||||
// Error represents an error with the intent to be sent in the HTTP
|
// Error represents an error with the intent to be sent in the HTTP
|
||||||
// response to the client. Therefore, it also contains a HTTPResponse,
|
// response to the client. Therefore, it also contains a HTTPResponse,
|
||||||
// next to an error code and error message.
|
// next to an error code and error message.
|
||||||
|
// TODO: Error is not comparable anymore because HTTPResponse
|
||||||
|
// contains a map. See if we should change this.
|
||||||
type Error struct {
|
type Error struct {
|
||||||
ErrorCode string
|
ErrorCode string
|
||||||
Message string
|
Message string
|
||||||
|
|
Loading…
Reference in New Issue