Skip to content

Commit a22f228

Browse files
committed
Improve error message
Improve the error message when a server is started with no listener specified Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent 01f5223 commit a22f228

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/asynchronous/server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ impl Server {
117117
}
118118

119119
fn get_listener(&mut self) -> Result<Listener> {
120-
self.listeners
121-
.pop()
122-
.ok_or_else(|| Error::Others("ttrpc-rust not bind".to_string()))
120+
self.listeners.pop().ok_or_else(|| {
121+
Error::Others("ttrpc-rust server started with no bound listener".to_string())
122+
})
123123
}
124124

125125
pub async fn start(&mut self) -> Result<()> {

0 commit comments

Comments
 (0)