9 Commits

Author SHA1 Message Date
HoneyryderChuck
092e594a4b Request.verb is now an upcased string (ex: "GET")
The reference for a request verb is now the string which is used
everywhere else, instead of the symbol corresponding to it. This was an
artifact from the import from httprb, and there is no advantage in it,
since these strings are frozen in most use cases, and the
transformations from symbol to strings being performed everywhere are
prooof that keeping the atom isn't really bringing any benefit.
2023-04-17 16:54:31 +03:00
HoneyryderChuck
f768cf7a0e Improving API compatibility and error checking in responses
* `Response#error`, which, coupled with `ErrorResponse#error`, allows
  for `if response.error` kind of conditional;
* `Response#raise_for_status` now returns the response when no error is
  raise (for method chaining);

Closes #153
2021-09-20 13:02:20 +01:00
HoneyryderChuck
7aea7fe471 removing a few method_missing implementations
replacing them with SimpleDelegator where it made sense, and removing
them altogether whenever possible. ErrorResponse doesn't have a special
handling for Response methods anymore, but it's highly debatable if it
should.
2021-07-21 15:31:49 +01:00
HoneyryderChuck
1cf6e5aac7 new option: origin
by setting the origin, one can pass relative paths to httpx, which will
be appended when building the request.
2021-05-04 20:09:50 +01:00
HoneyryderChuck
edfd92ea60 added test for to_s rep of error response (i.e. must contain the canonical message class def) 2021-02-19 16:42:39 +00:00
HoneyryderChuck
9efd2a0a2e fixed the request mock, which triggered a typing error 2020-10-30 16:19:18 +00:00
HoneyryderChuck
5823a040d0 adding more methods necessary for the faraday adapter when it comes to multi-response errors 2020-04-13 18:07:27 +01:00
HoneyryderChuck
9a4b836ae7 error response must also reflect the request 2019-05-24 17:58:29 +03:00
HoneyryderChuck
05d9ca909f added a way to log exceptions, and use it in error responses, which are now tested 2018-12-31 02:55:03 +00:00