Files
mkdocs/doc/meshkernelpy/api/meshkernel.errors.md
T
2026-10-10 21:56:35 +08:00

92 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 异常类型
模块:`meshkernel.errors`。本页依据本地 MeshKernelPy `8.3.0` 源码生成,包含该模块定义的类、方法、函数和常量。签名及参数默认值以源码为准;原文未提供的说明会明确标记。
[返回 API 总览](modules.md)
## `Error` {#error}
继承:`Exception`。
本模块中所有异常的基类。
## `InputError` {#inputerror}
继承:`Error`。
输入发生错误时抛出的异常。
## `MeshKernelError` {#meshkernelerror}
继承:`Error`。
MeshKernel 库发生错误时抛出的异常。
**方法索引**
- [`__init__`](#meshkernelerror---init--)
### `MeshKernelError.__init__` {#meshkernelerror---init--}
```python
__init__(self, category: str, message: str)
```
构造实例。源码没有单独编写此构造函数的文档字符串,参数及默认值如下。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `category` | `str` | `必填` | 源码未单独提供参数说明。 |
| `message` | `str` | `必填` | 源码未单独提供参数说明。 |
## `MeshGeometryError` {#meshgeometryerror}
继承:`MeshKernelError`。
MeshKernel 库发生网格几何错误时抛出的异常。
**方法索引**
- [`__init__`](#meshgeometryerror---init--)
- [`index`](#meshgeometryerror-index)
- [`location`](#meshgeometryerror-location)
### `MeshGeometryError.__init__` {#meshgeometryerror---init--}
```python
__init__(self, message: str, info: Tuple[int, mps.Mesh2dLocation])
```
构造实例。源码没有单独编写此构造函数的文档字符串,参数及默认值如下。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `message` | `str` | `必填` | 源码未单独提供参数说明。 |
| `info` | `Tuple[int, mps.Mesh2dLocation]` | `必填` | 源码未单独提供参数说明。 |
### `MeshGeometryError.index` {#meshgeometryerror-index}
```python
index(self) -> int
```
返回几何错误信息中的索引 `info[0]`。
**返回类型**:`int`。源码未单独说明返回值。
### `MeshGeometryError.location` {#meshgeometryerror-location}
```python
location(self) -> mps.Mesh2dLocation
```
返回几何错误信息中的位置类型 `info[1]`。
**返回类型**:`mps.Mesh2dLocation`。源码未单独说明返回值。