2025-03-22 11:54:15 +03:00
|
|
|
---
|
|
|
|
|
sidebar_position: 8
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
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-04-07 11:24:09 +03:00
|
|
|
Address = "45.79.112.203:4242";
|
|
|
|
|
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
|
|
|
|
|
```
|