Skip to content

Commit

Permalink
Document exported errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dgmorales committed Mar 16, 2022
1 parent 5db9e4c commit aa48c2c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@ import (
)

var (
ErrRepoNotFound = fmt.Errorf("repo was not found (status code %d)", http.StatusNotFound)
ErrUnprocessableEntity = fmt.Errorf("unprocessable entity (status code %d)", http.StatusUnprocessableEntity)
// ErrRepoNotFound is returned by Get() when we receive a 404 Not Found status code
ErrRepoNotFound = fmt.Errorf("repo was not found (status code %d)", http.StatusNotFound)

// ErrUnprocessableEntity is returned by Add() when the repo already exists,
// or there is some error in the RepositoryConfig spec.
// It may be returned by the API on other cases, we suppose, or by Update().
ErrUnprocessableEntity = fmt.Errorf("unprocessable entity (status code %d)", http.StatusUnprocessableEntity)

// ErrUnexpectedStatusCode is returned by Get(), Add() or Update() when we get an
// unpexpected status code from the API
ErrUnexpectedStatusCode = errors.New("unexpected status code on response")
)

Expand Down

0 comments on commit aa48c2c

Please sign in to comment.