Skip to content

Commit

Permalink
isolated the 408 into its own error which is ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Jan 25, 2022
1 parent 2a083ec commit ca830f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
deno-version: ${{ matrix.deno-version }}

- name: Set NATS Server Version
run: echo "NATS_VERSION=v2.6.5" >> $GITHUB_ENV
run: echo "NATS_VERSION=v2.7.0" >> $GITHUB_ENV

# this here because dns seems to be wedged on gha
- name: Add hosts to /etc/hosts
Expand Down
4 changes: 3 additions & 1 deletion nats-base-client/jsclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ export class JetStreamClientImpl extends BaseApiClient
timer = null;
}
if (
isNatsError(err) && err.code === ErrorCode.JetStream404NoMessages
isNatsError(err) &&
(err.code === ErrorCode.JetStream404NoMessages ||
err.code === ErrorCode.JetStream408RequestTimeout)
) {
qi.stop();
} else {
Expand Down
2 changes: 1 addition & 1 deletion nats-base-client/jsutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function checkJsErrorCode(
switch (code) {
case 408:
return NatsError.errorForCode(
ErrorCode.JetStream404NoMessages,
ErrorCode.JetStream408RequestTimeout,
new Error(description),
);
case 503:
Expand Down

0 comments on commit ca830f8

Please sign in to comment.