1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-06 06:45:35 +01:00

7 Commits

Author SHA1 Message Date
Prashanth Pai
7b84ef8757 txn: Add CLI support to parse txn error
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-06-06 21:37:02 +05:30
Prashanth Pai
db80e2be41 txn: Return detailed error to client
The txn framework now returns detailed error to the client i.e which step
failed on which peer and with what error.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-06-06 18:16:50 +05:30
Prashanth Pai
681c6b8987 Set generic error code to 1, not 0
...as 0 can indicate success.

* Added a comment with usage example for SendHTTPError()
* Handled case of passing nil:
    SendHTTPError(ctx, http.StatusBadRequest, nil, api.SomeErrorCode)

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-03-22 14:44:26 +05:30
Prashanth Pai
2dd9b85c48 Simplify SendHTTPError()
* Remove having to specify default error code. It is made implicit
  instead. This removes some of the code clutter.
* Support returning multiple errors in a single API response.
  Although this will be rarely used, introducing the provision in API
  right now is better than later.
* Allow callers to pass both string and error types.
* Introduce a error code map which maps error codes (integers) to their
  brief textual description.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-03-21 20:16:53 +05:30
Aravinda VK
16482780f0 Added error code argument to SendHTTPError
Added extra argument to SendHTTPError function and added default error
code in all places.

To add a new error code, add entry in `pkg/api/errors.go` and then use
while calling SendHTTPError

Updates: #419
Signed-off-by: Aravinda VK <mail@aravindavk.in>
2017-11-16 12:38:49 +05:30
Aravinda VK
266091563a restclient: Fixed glint error
Updates: #265
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2017-08-10 18:11:16 +05:30
Aravinda VK
5a3282a68c restclient: Redundant json marshal and APIs simplified
Updates: #265
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2017-08-10 15:12:37 +05:30