agola/internal/util
Simone Gotti c1da3ab566 *: Improve error handling
* Create an APIError that should only be used for api returned errors.
  It'll wrap an error and can have different Kinds and optional code and
  message.
* The http handlers will use the first APIError available in the
  error chain and generate a json response body containing the code and
  the user message. The wrapped error is internal and is not sent in the
  response.
  If no api error is available in the chain a generic internal
  server error will be returned.
* Add a RemoteError type that will be created from remote services calls
  (runservice, configstore). It's similar to the APIError but a
  different type to not propagate to the caller response and it'll not
  contain any wrapped error.
* Gateway: when we call a remote service, by default, we'll create a
  APIError using the RemoteError Kind (omitting the code and the
  message that usually must not be propagated).
  This is done for all the remote service calls as a starting point, in
  future, if this default behavior is not the right one for a specific
  remote service call, a new api error with a different kind and/or
  augmented with the calling service error codes and user messages could
  be created.
* datamanager: Use a dedicated ErrNotExist (and converting objectstorage
  ErrNotExist).
2022-02-25 16:11:19 +01:00
..
backoff.go configstore: move configstore types inside configstore package 2019-08-02 10:05:47 +02:00
buffer.go runservice: implement caching 2019-04-13 14:58:56 +02:00
dump.go Add dump util 2019-02-21 16:30:34 +01:00
errors.go *: Improve error handling 2022-02-25 16:11:19 +01:00
git.go *: use errors.Is/errors.As to handle wrapped error checking 2022-02-24 17:07:29 +01:00
goroutine.go util: add GoWait function 2019-07-26 10:55:04 +02:00
http.go *: Improve error handling 2022-02-25 16:11:19 +01:00
password.go *: use errors.Is/errors.As to handle wrapped error checking 2022-02-24 17:07:29 +01:00
path.go util: Fix PathList output when path ends with slashes 2019-09-09 14:49:00 +02:00
path_test.go util: Fix PathList output when path ends with slashes 2019-09-09 14:49:00 +02:00
pointer.go util: add pointer utils 2019-04-24 16:31:14 +02:00
sha.go internal: fix linter errors 2019-07-02 16:20:53 +02:00
slice.go internal: fix linter errors 2019-07-02 16:20:53 +02:00
slice_test.go Add slice utils 2019-02-21 16:32:27 +01:00
ssh.go gateway: initial implementation 2019-02-21 17:58:25 +01:00
string.go Add slice utils 2019-02-21 16:32:27 +01:00
tls.go Add tls util 2019-02-21 16:23:36 +01:00
uuid.go go.mod: replace https://github.com/satori/go.uuid 2022-02-21 09:43:32 +01:00
validation.go go.mod: replace https://github.com/satori/go.uuid 2022-02-21 09:43:32 +01:00
validation_test.go validation: make uuid like names not valid 2019-05-02 23:40:28 +02:00