Adds details to errors and fixes error propagation bug (#239)

This commit is contained in:
zainkabani
2022-11-17 09:24:39 -08:00
committed by GitHub
parent fcd2cae4e1
commit c62b86f4e6
6 changed files with 94 additions and 48 deletions

View File

@@ -37,7 +37,10 @@ where
let code = query.get_u8() as char;
if code != 'Q' {
return Err(Error::ProtocolSyncError);
return Err(Error::ProtocolSyncError(format!(
"Invalid code, expected 'Q' but got '{}'",
code
)));
}
let len = query.get_i32() as usize;