File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,14 @@ fn map_prompt_error_to_task_error(provider: ModelProvider, err: PromptError) ->
247
247
"cuda_malloc_failed"
248
248
} else if ollama_error. contains ( "CUDA error: out of memory" ) {
249
249
"cuda_oom"
250
+ } else if ollama_error. contains ( "API Error: Too Many Requests" ) {
251
+ "api:too_many_requests"
252
+ } else if ollama_error. contains ( "API Error: Bad Request" ) {
253
+ "api:bad_request"
254
+ } else if ollama_error. contains ( "not found, try pulling it first" ) {
255
+ "model_not_pulled"
256
+ } else if ollama_error. contains ( "Unexpected end of JSON input" ) {
257
+ "unexpected_end_of_json"
250
258
} else {
251
259
"unknown"
252
260
} ;
@@ -260,7 +268,10 @@ fn map_prompt_error_to_task_error(provider: ModelProvider, err: PromptError) ->
260
268
) ,
261
269
}
262
270
// if we couldn't parse it, just return a generic prompt error
263
- . unwrap_or ( TaskError :: ExecutorError ( err_inner. clone ( ) ) )
271
+ . unwrap_or ( TaskError :: ExecutorError ( format ! (
272
+ "{provider} executor error: {}" ,
273
+ err_inner. clone( )
274
+ ) ) )
264
275
}
265
276
// if its a http error, we can try to parse it as well
266
277
PromptError :: CompletionError ( CompletionError :: HttpError ( err_inner) ) => {
You can’t perform that action at this time.
0 commit comments