Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-dap/src/lib.rs')
-rw-r--r--helix-dap/src/lib.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/helix-dap/src/lib.rs b/helix-dap/src/lib.rs
index 16c84f66..4cb95315 100644
--- a/helix-dap/src/lib.rs
+++ b/helix-dap/src/lib.rs
@@ -13,7 +13,7 @@ use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("failed to parse: {0}")]
- Parse(#[from] serde_json::Error),
+ Parse(Box<dyn std::error::Error + Send + Sync>),
#[error("IO Error: {0}")]
IO(#[from] std::io::Error),
#[error("request {0} timed out")]
@@ -29,6 +29,18 @@ pub enum Error {
}
pub type Result<T> = core::result::Result<T, Error>;
+impl From<serde_json::Error> for Error {
+ fn from(value: serde_json::Error) -> Self {
+ Self::Parse(Box::new(value))
+ }
+}
+
+impl From<sonic_rs::Error> for Error {
+ fn from(value: sonic_rs::Error) -> Self {
+ Self::Parse(Box::new(value))
+ }
+}
+
#[derive(Debug)]
pub enum Request {
RunInTerminal(<requests::RunInTerminal as types::Request>::Arguments),