Skip to content

It should be possible to pass Error object to ServiceStream.abort #74

@azasypkin

Description

@azasypkin

Currently if you pass real Error object to stream you'll get "DataCloneError: The object could not be cloned" exception. Would be helpful if Bridge can to at least extract actual error message and send back to client.

To reproduce issue you can just have a service with stream method that calls abort once stream is initiated:

service.stream(
  'test-stream',
  (stream) => stream.abort(new Error('Custom error message'))
);

and client:

var clientStream = client.stream('test-stream');
clientStream.closed.catch((e) => console.error(e));

----->
// 'Custom error message'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions