From 92c5c6cb03fff20b4b54c0176882218b169d9652 Mon Sep 17 00:00:00 2001 From: raphCode <15750438+raphCode@users.noreply.github.com> Date: Tue, 7 Jun 2022 17:14:22 +0200 Subject: [PATCH] Add logging to ipc receiver (#1459) * Add logging to ipc receiver * Add to changelog --- CHANGELOG.md | 1 + zellij-utils/src/ipc.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a741496f..0abe94fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +* feat: Log errors causing "empty message received from client" (https://github.com/zellij-org/zellij/pull/1459) ## [0.30.0] - 2022-06-07 * fix: right and middle clicks creating selection (https://github.com/zellij-org/zellij/pull/1372) diff --git a/zellij-utils/src/ipc.rs b/zellij-utils/src/ipc.rs index 4d76c088..ea6b4039 100644 --- a/zellij-utils/src/ipc.rs +++ b/zellij-utils/src/ipc.rs @@ -7,6 +7,7 @@ use crate::{ pane_size::{Size, SizeInPixels}, }; use interprocess::local_socket::LocalSocketStream; +use log::warn; use nix::unistd::dup; use serde::{Deserialize, Serialize}; use std::{ @@ -189,7 +190,10 @@ where pub fn recv(&mut self) -> Option<(T, ErrorContext)> { match bincode::deserialize_from(&mut self.receiver) { Ok(msg) => Some(msg), - Err(_) => None, + Err(e) => { + warn!("Error in IpcReceiver.recv(): {:?}", e); + None + } } }