(bucket string)
| 105 | } |
| 106 | |
| 107 | func (o *ObjectNode) getVol(bucket string) (vol *Volume, err error) { |
| 108 | if bucket == "" { |
| 109 | return nil, errors.New("bucket name is empty") |
| 110 | } |
| 111 | vol, err = o.vm.Volume(bucket) |
| 112 | if err != nil { |
| 113 | log.LogErrorf("getVol: load Volume fail, bucket(%v) err(%v)", bucket, err) |
| 114 | if err == proto.ErrVolNotExists { |
| 115 | err = NoSuchBucket |
| 116 | return |
| 117 | } |
| 118 | err = InternalErrorCode(err) |
| 119 | return |
| 120 | } |
| 121 | return vol, nil |
| 122 | } |
| 123 | |
| 124 | func (o *ObjectNode) errorResponse(w http.ResponseWriter, r *http.Request, err error, ec *ErrorCode) { |
| 125 | if err != nil || ec != nil { |
no test coverage detected