azurestore: Work around error being not comparable
This commit is contained in:
parent
e77cc64063
commit
7eae867ec1
|
@ -112,8 +112,12 @@ func (store AzureStore) GetUpload(ctx context.Context, id string) (handler.Uploa
|
|||
}
|
||||
|
||||
offset, err := blockBlob.GetOffset(ctx)
|
||||
if err != nil && err != handler.ErrNotFound {
|
||||
return nil, err
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
info.Offset = offset
|
||||
|
|
|
@ -3,6 +3,8 @@ package handler
|
|||
// Error represents an error with the intent to be sent in the HTTP
|
||||
// response to the client. Therefore, it also contains a HTTPResponse,
|
||||
// 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 {
|
||||
ErrorCode string
|
||||
Message string
|
||||
|
|
Loading…
Reference in New Issue