Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
80b538e3
Unverified
Commit
80b538e3
authored
Jul 23, 2025
by
Patrick Devine
Committed by
GitHub
Jul 23, 2025
Browse files
cli: catch upstream errors gracefully (#11512)
parent
4f8a0166
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
cmd/cmd.go
cmd/cmd.go
+8
-0
No files found.
cmd/cmd.go
View file @
80b538e3
...
@@ -1137,6 +1137,14 @@ func chat(cmd *cobra.Command, opts runOptions) (*api.Message, error) {
...
@@ -1137,6 +1137,14 @@ func chat(cmd *cobra.Command, opts runOptions) (*api.Message, error) {
if
errors
.
Is
(
err
,
context
.
Canceled
)
{
if
errors
.
Is
(
err
,
context
.
Canceled
)
{
return
nil
,
nil
return
nil
,
nil
}
}
// this error should ideally be wrapped properly by the client
if
strings
.
Contains
(
err
.
Error
(),
"upstream error"
)
{
p
.
StopAndClear
()
fmt
.
Println
(
"An error occurred while processing your message. Please try again."
)
fmt
.
Println
()
return
nil
,
nil
}
return
nil
,
err
return
nil
,
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment