> ## Documentation Index
> Fetch the complete documentation index at: https://baileys.wiki/llms.txt
> Use this file to discover all available pages before exploring further.

# getErrorCodeFromStreamError

> Stream errors generally provide a reason, map that to a baileys DisconnectReason

> **getErrorCodeFromStreamError**(`node`): `object`

Defined in: [src/Utils/generics.ts:364](https://github.com/WhiskeySockets/Baileys/blob/master/src/Utils/generics.ts#L364)

Stream errors generally provide a reason, map that to a baileys DisconnectReason

## Parameters

### node

[`BinaryNode`](/api-reference/type-aliases/BinaryNode)

## Returns

`object`

### reason

> **reason**: `string`

### statusCode

> **statusCode**: `number`
