Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Custom Error Codes #218

Open
palamccc opened this issue Mar 1, 2022 · 0 comments
Open

Add support for Custom Error Codes #218

palamccc opened this issue Mar 1, 2022 · 0 comments
Labels
0.x Issues relating to 0.x version(s) enhancement Suggests, requests, or implements a feature or enhancement

Comments

@palamccc
Copy link

palamccc commented Mar 1, 2022

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.

@viglucci viglucci added the enhancement Suggests, requests, or implements a feature or enhancement label Mar 6, 2022
@viglucci viglucci added the 0.x Issues relating to 0.x version(s) label Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.x Issues relating to 0.x version(s) enhancement Suggests, requests, or implements a feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants