Skip to content

Commit

Permalink
v6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Payne committed Aug 25, 2023
1 parent 204b1db commit c06e13a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
## [v6.0.0](https://github.com/EventStore/EventStore-Client-NodeJS/compare/v5.0.1...v6.0.0) (2023-08-25)

## Breaking changes

### `CancelledError` is now thrown when a stream is cancelled by the server

Previously, we would throw an `UnavailableError` when the server was unavailable to take a request, _or_ a stream was cancelled by the server. This release now throws a `CancelledError` when the stream is cancelled, allowing users to distinguish between them.

If users are catching `UnavailableError` on a stream for this situation, they should now be looking for a `CancelledError`. [View](https://github.com/EventStore/EventStore-Client-NodeJS/commit/022b150842800a2aa0ba297154061f941fbb8ca9)

Before:

```ts
try {
for await (const event of client.readStream("my_stream")) {
// do something
}
} catch (error) {
if (isCommandError(error)) {
if (error.type === ErrorType.UNAVAILABLE) {
// Server is unavailable to take request
// _OR_
// Stream was cancelled by server
}
}
}
```

After:

```ts
try {
for await (const event of client.readStream("my_stream")) {
// do something
}
} catch (error) {
if (isCommandError(error)) {
if (error.type === ErrorType.CANCELLED) {
// Stream was cancelled by server
}

if (error.type === ErrorType.UNAVAILABLE) {
// Server is unavailable to take request
}
}
}
```

## Bug Fixes

- fix out of bounds value for stream revision [View](https://github.com/EventStore/EventStore-Client-NodeJS/commit/39094c2aa351fcb8f399a75168a322b7278ec467)

## [v5.0.1](https://github.com/EventStore/EventStore-Client-NodeJS/compare/v5.0.0...v5.0.1) (2023-02-16)

## Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eventstore/db-client",
"version": "5.0.1",
"version": "6.0.0",
"description": "NodeJS EventStoreDB version 20+ and uses gRPC as the communication protocol.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down

0 comments on commit c06e13a

Please sign in to comment.