return a better descriptive error when the blob isn't found
This commit is contained in:
parent
5c91051b78
commit
34ca7847d0
1 changed files with 4 additions and 0 deletions
|
@ -70,6 +70,10 @@ func (s *Server) Start(address string) error {
|
|||
requestedBlob := vars["hash"]
|
||||
blob, err := s.store.Get(requestedBlob)
|
||||
if err != nil {
|
||||
if errors.Is(err, store.ErrBlobNotFound) {
|
||||
http.Error(w, err.Error(), http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
fmt.Printf("%s: %s", requestedBlob, errors.FullTrace(err))
|
||||
s.logError(err)
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
|
|
Loading…
Reference in a new issue