Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 19dbed5

Browse files
committed
Respond to unhandled requests with MethodNotFound
1 parent 4b6bce1 commit 19dbed5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ impl App {
214214
}
215215
}
216216
self.reply(Response::new_ok(id, selections));
217+
} else {
218+
let req = req.expect("internal error: req should have been wrapped in Some");
219+
220+
self.reply(Response::new_err(
221+
req.id,
222+
ErrorCode::MethodNotFound as i32,
223+
format!("Unhandled method {}", req.method),
224+
))
217225
}
218226
Ok(())
219227
}

0 commit comments

Comments
 (0)