---
title: ErrorCode接口
description: "获取返回对象内的错误码。"
url: https://www.hiascend.com/document/detail/zh/mindie/latest/mindiellm/llmdev/mindie_llm0121.html
sourcePath: /source/zh/mindie/310/mindiellm/llmdev/mindie_llm0121.html
indexId: 1d2022826237c497201f985ede8fb76396f50cc8716f3f21c8e35fe6cd488ddb58
---
# ErrorCode接口

#### 接口功能

获取返回对象内的错误码。


#### 接口格式

```
Code ErrorCode() const;
```


#### 接口参数

无。


#### 使用样例

构造一个Error对象，然后获取该对象内的错误码。

```
Error(Error::Code::ERROR, "ERROR: Failed to get real path of home.").ErrorCode();
```


#### 返回值

错误码枚举。
