10 Commits

Author SHA1 Message Date
Jacek Sieka
98a5efba4d
Various error handling and processing fixes (#228)
* remove redundant gcsafe/raises
* rework async raises to chronos 4.0 where this was not yet done
* streamline logging between http/socket/ws
  * don't log error when raising exceptions (whoever handles should log)
  * debug-log requests in all variants of server and client
* unify ipv4/ipv6 address resolution, with preference for ipv6
* fix server start so that it consistently raises only when no addresses
could be bound
2024-10-22 21:58:46 +02:00
Kim De Mey
a20ba207d2
Introduce custom application error with optional data object (#216)
This addresses two items:
- Use ApplicationError instead of InvalidRequest for custom
application errors. Avoiding confusing regarding the usage of
InvalidRequest (although the actual error code used could/would
be different).
- Allow for defining an optional data object that gets returned
in the error response, as per json-rpc specification.
2024-03-04 09:19:28 +01:00
jangko
08ceae27e0
Move errors module back to json_rpc folder 2024-01-08 10:37:29 +07:00
andri lim
e0b077fea4
Upgrade rpc router internals (#178)
* Upgrade rpc router internals

* use new chronos asyncraises

* Fix style mismatch

* Fix nim v2 compilation error

* Addresing review

* Remove unnecessary custom serializer and let the library do the work

* fix error message

* Update readme.md
2024-01-03 20:06:53 +07:00
jangko
c3769f9130
Add copyright to source file 2023-12-14 08:34:13 +07:00
Zahary Karadjov
07e4705b1f
The ErrorResponse exception now preserves information about the HTTP status code and reason 2023-03-01 12:40:16 +02:00
Bernardo A. Rodrigues
3599a73b58
Chronos HTTP(S) Server (#111) 2021-11-22 15:14:30 +02:00
Zahary Karadjov
2307dbec57 Add support for producing custom error codes from request hanlers 2021-10-06 10:50:08 +02:00
Jacek Sieka
4eb39203eb
fixes (#95)
* fixes

* fix https://github.com/status-im/nimbus-eth2/issues/1650
* only one of `result` and `error` allowed in response
* fix invalid `string` instances being created from byte sequences
* fix large int64 parsing on 32-bit
* fix exception inheritance
* fix some dangling results
* some cleanups

* annotate exception issues, fix cancellation

* more error handling cleanup

* add rudimentary error tests

* cleanups

* simplify init
* use nextId -> lastId to avoid =1 init
* remove obsolete tests
2021-02-15 13:45:51 +01:00
Zahary Karadjov
244254632b
Improved handling of invalid responses; Handle seq[byte] results such as eth_getCode 2020-06-19 20:42:49 +03:00