gigachat-ruby 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -0
- data/lib/gigachat/errors.rb +6 -3
- data/lib/gigachat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 78c6d32e2190d2fe8549174536d3b659a98f9c5b2e1471638a807750f375b5c9
|
|
4
|
+
data.tar.gz: d937faa30b6007f3263a45053277810006ff5992bc626c59f31dbf4740221886
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 932dd4fdb2a79f8ebed405f7f46de5045f8c93404d1d3a21e969647f7628a5a10f7772963a99b73be53591ee4c52471223b988cb5eb988523f8e966826bfc516
|
|
7
|
+
data.tar.gz: d117c6b67bc49fa12c85c63c74a89f92713f65c9f9e0182f2cd68e856cc5c28c365c279bb060c767ccad9f6cd0392973f571fc3a07df0cc4be330b118bca46c0
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to this project are documented here. The format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [0.1.1] - 2026-10-02
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `GigaChat::PaymentRequiredError` for HTTP 402 (token balance exhausted). The OpenAPI spec doesn't list
|
|
12
|
+
this status, but the API returns it in practice.
|
|
13
|
+
|
|
7
14
|
## [0.1.0] - 2026-10-02
|
|
8
15
|
|
|
9
16
|
### Added
|
data/README.md
CHANGED
|
@@ -248,6 +248,7 @@ The API's `method` field is exposed as `batch_method`, because a `method` reader
|
|
|
248
248
|
|---|---|
|
|
249
249
|
| 400 | `GigaChat::BadRequestError` |
|
|
250
250
|
| 401 | `GigaChat::AuthenticationError` |
|
|
251
|
+
| 402 | `GigaChat::PaymentRequiredError` (token balance exhausted) |
|
|
251
252
|
| 403 | `GigaChat::PermissionDeniedError` |
|
|
252
253
|
| 404 | `GigaChat::NotFoundError` |
|
|
253
254
|
| 413 | `GigaChat::RequestEntityTooLargeError` |
|
data/lib/gigachat/errors.rb
CHANGED
|
@@ -27,9 +27,9 @@ module GigaChat
|
|
|
27
27
|
return ServerError if status >= 500
|
|
28
28
|
|
|
29
29
|
{
|
|
30
|
-
400 => BadRequestError, 401 => AuthenticationError,
|
|
31
|
-
|
|
32
|
-
429 => RateLimitError
|
|
30
|
+
400 => BadRequestError, 401 => AuthenticationError, 402 => PaymentRequiredError,
|
|
31
|
+
403 => PermissionDeniedError, 404 => NotFoundError, 413 => RequestEntityTooLargeError,
|
|
32
|
+
422 => UnprocessableEntityError, 429 => RateLimitError
|
|
33
33
|
}.fetch(status, APIError)
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -60,6 +60,9 @@ module GigaChat
|
|
|
60
60
|
|
|
61
61
|
class AuthenticationError < APIError; end
|
|
62
62
|
|
|
63
|
+
# 402: the token balance is exhausted. Not in the OpenAPI spec, but returned in practice.
|
|
64
|
+
class PaymentRequiredError < APIError; end
|
|
65
|
+
|
|
63
66
|
class PermissionDeniedError < APIError; end
|
|
64
67
|
|
|
65
68
|
class NotFoundError < APIError; end
|
data/lib/gigachat/version.rb
CHANGED