2025-03-22 11:54:15 +03:00
---
sidebar_position: 8
2025-05-05 11:15:20 +03:00
description: Get last error and other functions to work with TCP in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, TCP]
2025-03-22 11:54:15 +03:00
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2025-03-26 11:01:25 +03:00
# Get last error
2025-03-22 11:54:15 +03:00
Gets information about the last error in the connection
`Function GetLastError(Val Connection) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
2025-03-26 11:01:25 +03:00
| Connection | - | Arbitrary | ✔ | Connection, see. CreateConnection |
2025-03-22 11:54:15 +03:00
Returns: Map Of KeyAndValue, Undefined - Error information or undefined if there is no error
<br/>
2025-03-26 11:01:25 +03:00
:::caution
**NOCLI:** this method is not available in CLI version
:::
<br/>
2025-03-22 11:54:15 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2025-06-29 14:35:33 +03:00
Address = "45.79.112.203:4242";
2025-04-07 11:24:09 +03:00
Connection = OPI_TCP.CreateConnection(Address);
Data = "Hello server!" + Chars.LF;
2025-03-22 11:54:15 +03:00
2025-04-07 11:24:09 +03:00
Sending = OPI_TCP.SendLine(Connection, Data);
2025-03-22 11:54:15 +03:00
```
2025-04-07 16:01:23 +03:00
```json title="Result"
null
```