File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 3535
3636 return response . Success ? 0 : 1 ;
3737}
38+ catch ( System . Text . Json . JsonException jsonEx )
39+ {
40+ await WriteErrorResponse ( $ "JSON error: { jsonEx . Message } ") ;
41+ return 1 ;
42+ }
43+ catch ( IOException ioEx )
44+ {
45+ await WriteErrorResponse ( $ "I/O error: { ioEx . Message } ") ;
46+ return 1 ;
47+ }
3848catch ( Exception ex )
3949{
4050 await WriteErrorResponse ( $ "Unhandled exception: { ex . Message } ") ;
@@ -91,6 +101,27 @@ static async Task<AgentExecutionResponse> ExecuteAgentAsync(AgentExecutionReques
91101 response . Error = $ "Agent execution exceeded maximum duration of { request . MaxDurationSeconds ?? 60 } seconds";
92102 response . DurationMs = stopwatch . ElapsedMilliseconds ;
93103 }
104+ catch ( NotImplementedException notImplEx )
105+ {
106+ stopwatch . Stop ( ) ;
107+ response . Success = false ;
108+ response . Error = $ "Not implemented: { notImplEx . Message } ";
109+ response . DurationMs = stopwatch . ElapsedMilliseconds ;
110+ }
111+ catch ( InvalidOperationException invalidOpEx )
112+ {
113+ stopwatch . Stop ( ) ;
114+ response . Success = false ;
115+ response . Error = $ "Invalid operation: { invalidOpEx . Message } ";
116+ response . DurationMs = stopwatch . ElapsedMilliseconds ;
117+ }
118+ catch ( ArgumentException argEx )
119+ {
120+ stopwatch . Stop ( ) ;
121+ response . Success = false ;
122+ response . Error = $ "Invalid argument: { argEx . Message } ";
123+ response . DurationMs = stopwatch . ElapsedMilliseconds ;
124+ }
94125 catch ( Exception ex )
95126 {
96127 stopwatch . Stop ( ) ;
You can’t perform that action at this time.
0 commit comments