create serde compatible parse error

This commit is contained in:
Demonthos committed 2022-06-15 12:58:08 -05:00
1 parent 41e905144c
commit df4ea20bb8
9 files changed
+68 -45

No files matched your search

+5 -11
View File
@@ -81,17 +81,11 @@ impl DesktopController {
impl ErrorHandler for DesktopErrorHandler {
fn handle_error(&self, err: Error) {
if let Some(conn) = &mut *self.latest_connection.lock().unwrap() {
match err {
Error::RecompileRequiredError(reason) => {
conn.get_mut()
.write_all(
(serde_json::to_string(&reason).unwrap() + "\n")
.as_bytes(),
)
.unwrap();
}
Error::ParseError(err) => log::warn!("{}", err),
}
conn.get_mut()
.write_all(
(serde_json::to_string(&err).unwrap() + "\n").as_bytes(),
)
.unwrap();
}
}
}