Skip to content

Commit

Permalink
chore: convert unwrap to except and add a debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarrus1 committed Aug 8, 2023
1 parent d9e9ca2 commit 02d5c0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/lsp-server/src/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::{
thread,
};

use log::debug;

use crossbeam_channel::{bounded, Receiver, Sender};

use crate::Message;
Expand All @@ -23,7 +25,8 @@ pub(crate) fn stdio_transport() -> (Sender<Message>, Receiver<Message>, IoThread
while let Some(msg) = Message::read(&mut stdin)? {
let is_exit = matches!(&msg, Message::Notification(n) if n.is_exit());

reader_sender.send(msg).unwrap();
debug!("sending message {:#?}", msg);
reader_sender.send(msg).expect("receiver was dropped, failed to send a message");

if is_exit {
break;
Expand Down

0 comments on commit 02d5c0a

Please sign in to comment.