This repository was archived by the owner on Jan 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,7 @@ impl App {
135135 let id = req. id . clone ( ) ;
136136 match self . conn . handle_shutdown ( & req) {
137137 Ok ( true ) => break ,
138- Ok ( false ) => {
139- if let Err ( err) = self . handle_request ( req) {
140- self . err ( id, err) ;
141- }
142- }
138+ Ok ( false ) => self . handle_request ( req) ,
143139 Err ( err) => {
144140 // This only fails if a shutdown was
145141 // requested in the first place, so it
@@ -157,7 +153,7 @@ impl App {
157153 }
158154 }
159155 }
160- fn handle_request ( & mut self , req : Request ) -> Result < ( ) , Error > {
156+ fn handle_request ( & mut self , req : Request ) {
161157 fn cast < Kind > ( req : & mut Option < Request > ) -> Option < ( RequestId , Kind :: Params ) >
162158 where
163159 Kind : RequestTrait ,
@@ -214,8 +210,15 @@ impl App {
214210 }
215211 }
216212 self . reply ( Response :: new_ok ( id, selections) ) ;
213+ } else {
214+ let req = req. expect ( "internal error: req should have been wrapped in Some" ) ;
215+
216+ self . reply ( Response :: new_err (
217+ req. id ,
218+ ErrorCode :: MethodNotFound as i32 ,
219+ format ! ( "Unhandled method {}" , req. method) ,
220+ ) )
217221 }
218- Ok ( ( ) )
219222 }
220223 fn handle_notification ( & mut self , req : Notification ) -> Result < ( ) , Error > {
221224 match & * req. method {
You can’t perform that action at this time.
0 commit comments