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

fix error message type for WebSocket events #118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bennycode
Copy link

@bennycode bennycode commented Oct 3, 2023

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