From 6a363a4b13bb3cb4c3d3665130a8125f830ea753 Mon Sep 17 00:00:00 2001 From: Kevin Hermawan <84965338+kevinhermawan@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:05:53 +0700 Subject: [PATCH] docs: adds stream error handling (#9) --- README.md | 5 ++++- Sources/LLMChatAnthropic/Documentation.docc/Documentation.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c9a82b..ba55100 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,10 @@ do { print("Network Error: \(error.localizedDescription)") case .decodingError(let error): // Handle errors that occur when the response cannot be decoded - print("Decoding Error: \(error)") + print("Decoding Error: \(error.localizedDescription)") + case .streamError: + // Handle errors that occur when streaming responses + print("Stream Error") case .cancelled: // Handle requests that are cancelled print("Request was cancelled") diff --git a/Sources/LLMChatAnthropic/Documentation.docc/Documentation.md b/Sources/LLMChatAnthropic/Documentation.docc/Documentation.md index be3662e..247d1ce 100644 --- a/Sources/LLMChatAnthropic/Documentation.docc/Documentation.md +++ b/Sources/LLMChatAnthropic/Documentation.docc/Documentation.md @@ -188,7 +188,10 @@ do { print("Network Error: \(error.localizedDescription)") case .decodingError(let error): // Handle errors that occur when the response cannot be decoded - print("Decoding Error: \(error)") + print("Decoding Error: \(error.localizedDescription)") + case .streamError: + // Handle errors that occur when streaming responses + print("Stream Error") case .cancelled: // Handle requests that are cancelled print("Request was cancelled")