rsocket / rsocket-kotlin

RSocket Kotlin multi-platform implementation
http://rsocket.io
Apache License 2.0
553 stars 37 forks source link

make RSocketError.Custom.errorCode usable #137

Closed alexvas closed 3 years ago

alexvas commented 3 years ago

The errorCode field of RSocketError made internal, it is not accessible from application code.

Motivation

An RSocketError.Custom has an error code associated with it. Allowed errorCode value should be in range [0x00000301-0xFFFFFFFE]. The only sane reason to set the code for custom exception is an ability to inspect it later within application.

  1. the code value is not usable within application when errorCode is internal;
  2. it is not clear what minimal allowed value is until IAE is thrown. ErrorCode.CustomMin constant -- the lower bond -- is also internal.

Desired solution

Make both errorCode and ErrorCode.CustomMin public.