Chunk #627
Aus: Chat-API (Index: 5)
106
Tokens
Synced
Status
Taxonomie
| Kategorie | API |
|---|---|
| Pfad | API > Error Handling > Exception Handling |
| Heading-Pfad | Chat-API > Chat API > Fehlerbehandlung > Exception-Handling |
Entities
| Name | Typ |
|---|---|
| RuntimeException | TECHNOLOGY |
| AIConfig | CONFIG |
| ChatService | SERVICE |
| chat | COMMAND |
Keywords
Inhalt
Alle Services werfen RuntimeException bei Fehlern:
try {
$config = AIConfig::fromCredentialsFile();
$chat = $config->createChatService();
$result = $chat->chat($question);
} catch (RuntimeException $e) {
// Fehler-Logging
error_log('Chat failed: ' . $e->getMessage());
// JSON Response
http_response_code(500);
echo json_encode([
'error' => 'Chat request failed',
'message' => $e->getMessage()
]);
}Clean Content
Alle Services werfen RuntimeException bei Fehlern:
```
`try {
$config = AIConfig::fromCredentialsFile();
$chat = $config->createChatService();
$result = $chat->chat($question);
} catch (RuntimeException $e) {
// Fehler-Logging
error_log('Chat failed: ' . $e->getMessage());
// JSON Response
http_response_code(500);
echo json_encode([
'error' => 'Chat request failed',
'message' => $e->getMessage()
]);
}`
```
Metadaten
| Analysiert am | 20.12.2025 12:47:56 |
|---|---|
| Analyse-Modell | gemma3:4b-it-qat |
| Embedding-Modell | mxbai-embed-large |
| Qdrant-ID | a9758008-288a-4084-89b1-e2547f7ca8b8 |
| Erstellt | 20.12.2025 12:34:42 |
| Aktualisiert | 20.12.2025 12:53:41 |