Skip to content

Add support for Custom Error Codes #218

Open
@palamccc

Description

@palamccc

Motivation

In Java implementation, custom application errors can be thrown using RSocketErrorException.
https://github.com/rsocket/rsocket-java/blob/37fc68c68f4b61d826084330a7b0476a456b63da/rsocket-core/src/main/java/io/rsocket/RSocketErrorException.java#L27

But in Js implementation, there is no way to throw custom Errors, All Js Errors are captured and serialized with the same error code APPLICATION_ERROR.

this._connection.sendOne({
code: ERROR_CODES.APPLICATION_ERROR,
flags: 0,
message: errorMessage,
streamId,
type: FRAME_TYPES.ERROR,
});

Desired solution

Add custom Error class RSocketError and use its error code in the error frame.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.xIssues relating to 0.x version(s)enhancementSuggests, requests, or implements a feature or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions