Commit 6bfcaa6
committed
feature #543 [Platform][OpenAI] Add AuthenticationException for better error handling (vitalii-kyktov, vitality)
This PR was merged into the main branch.
Discussion
----------
[Platform][OpenAI] Add AuthenticationException for better error handling
| Q | A
| ------------- | ---
| Branch? | main
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #528
| License | MIT
When OpenAI API returns 401 (authentication error), users now get a clear AuthenticationException with the actual API error message instead of the confusing "Response does not contain choices" error.
Changes:
- Add AuthenticationException class for API authentication failures
- Update OpenAI ResultConverter to check HTTP 401 status before processing
- Add test coverage for authentication error scenarios
Commits
-------
193b56a [Platform][OpenAI] remove incomplete `@author` tags from AuthenticationException
7da46cb [Platform][OpenAI] simplify authentication error test structure
56881ba [Platform][OpenAI] Add AuthenticationException for better error handlingFile tree
3 files changed
+48
-0
lines changed- src/platform
- src
- Bridge/OpenAi/Gpt
- Exception
- tests/Bridge/OpenAi/Gpt
3 files changed
+48
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
158 | 176 | | |
159 | 177 | | |
160 | 178 | | |
| |||
0 commit comments