Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

fix error message type for WebSocket events#118

Open
bennycode wants to merge 1 commit into
alpacahq:mainfrom
bennycode:patch-1
Open

fix error message type for WebSocket events#118
bennycode wants to merge 1 commit into
alpacahq:mainfrom
bennycode:patch-1

Conversation

@bennycode

@bennycode bennycode commented Oct 3, 2023

Copy link
Copy Markdown

I noticed that the error object looks as follows:

{
  "code": 406,
  "msg": "connection limit exceeded",
  "T": "error"
}

My test code:

import {AlpacaStream, Message} from '@master-chief/alpaca';

const connection = new AlpacaStream({
  credentials: {
    key: options.apiKey,
    paper: options.usePaperTrading,
    secret: options.apiSecret,
  },
  source: 'iex',
  type: "market_data",
});

connection.once("error", (error: Message) => {
  console.log(error);
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant