# 來源、批次結果與例外 (https://nolantw.github.io/cwa/reference/results/)

## `AmbiguousLocationError`

```python
candidates: tuple[str, ...]
```

指定名稱符合多個地點。

## `AuthenticationError`

```python
class AuthenticationError
```

氣象署拒絕授權碼。

## `BatchError`

```python
failures: Mapping[Hashable, CWAError]
completed: tuple[Hashable, ...]
```

批次中有項目失敗。可由例外取得失敗項目及已完成的地點。

## `BatchResult`

```python
successes: Mapping[K, V]
failures: Mapping[K, Failure]
complete: bool
```

批次查詢中成功與失敗的項目。

## `CWAError`

```python
class CWAError
```

SDK 例外的基底類別。

## `ClientClosedError`

```python
class ClientClosedError
```

用戶端已關閉。

## `ConfigurationError`

```python
class ConfigurationError
```

用戶端設定有誤。

## `DataValidationError`

```python
class DataValidationError
```

回應資料未通過驗證。

## `Failure`

```python
kind: type[CWAError]
message: str
status: int | None
```

批次中單一失敗項目的錯誤類型、訊息及狀態碼。

### `Failure.from_error`

```python
def from_error(error: CWAError) -> Failure
```

從 SDK 例外取得單一失敗項目的資訊。

## `MissingDependencyError`

```python
class MissingDependencyError
```

使用的選用功能未安裝對應的額外套件。

## `NotFoundError`

```python
class NotFoundError
```

查無指定資料。

## `RateLimitError`

```python
class RateLimitError
```

請求頻率超過氣象署限制。重試等待時間以秒為單位。

## `RequestTimeoutError`

```python
class RequestTimeoutError
```

請求逾時。

## `Source`

```python
dataset_id: str
retrieved_at: datetime
issued_at: datetime | None
updated_at: datetime | None
observed_at: datetime | None
stale: bool
partial: bool
```

資料集編號、取得時間及氣象署提供的時間資訊。

## `TransportError`

```python
class TransportError
```

網路請求失敗。

## `UnknownLocationError`

```python
class UnknownLocationError
```

查無指定地點。

## `UpstreamError`

```python
class UpstreamError
```

氣象署拒絕請求或無法提供資料。