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) ->
247247 "cuda_malloc_failed"
248248 } else if ollama_error. contains ( "CUDA error: out of memory" ) {
249249 "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"
250258 } else {
251259 "unknown"
252260 } ;
@@ -260,7 +268,10 @@ fn map_prompt_error_to_task_error(provider: ModelProvider, err: PromptError) ->
260268 ) ,
261269 }
262270 // 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+ ) ) )
264275 }
265276 // if its a http error, we can try to parse it as well
266277 PromptError :: CompletionError ( CompletionError :: HttpError ( err_inner) ) => {
You can’t perform that action at this time.
0 commit comments