diff --git a/packages/hurl/src/output/raw.rs b/packages/hurl/src/output/raw.rs
index 0d49c4d4263..b6693e570a0 100644
--- a/packages/hurl/src/output/raw.rs
+++ b/packages/hurl/src/output/raw.rs
@@ -18,7 +18,7 @@
use hurl_core::ast::SourceInfo;
use hurl_core::error::Error;
-use crate::runner::{HurlResult, RunnerError};
+use crate::runner::HurlResult;
use crate::util::logger::Logger;
use crate::{output, runner};
@@ -54,11 +54,8 @@ pub fn write_body(
// FIXME: we convert to a runner::Error to be able to use fixme
// method. Can we do otherwise (without creating an artificial
// error a first character).
- let error = runner::Error {
- source_info: SourceInfo::new(0, 0, 0, 0),
- inner: RunnerError::from(e),
- assert: false,
- };
+ let source_info = SourceInfo::new(0, 0, 0, 0);
+ let error = runner::Error::new(source_info, e.into(), false);
let message = error.fixme();
return Err(output::error::Error::new(&message));
}
diff --git a/packages/hurl/src/report/junit/mod.rs b/packages/hurl/src/report/junit/mod.rs
index e2ee010049f..f7f7e815f8a 100644
--- a/packages/hurl/src/report/junit/mod.rs
+++ b/packages/hurl/src/report/junit/mod.rs
@@ -156,13 +156,13 @@ mod tests {
calls: vec![],
captures: vec![],
asserts: vec![],
- errors: vec![Error {
- source_info: SourceInfo::new(2, 10, 2, 13),
- inner: RunnerError::AssertStatus {
+ errors: vec![Error::new(
+ SourceInfo::new(2, 10, 2, 13),
+ RunnerError::AssertStatus {
actual: "404".to_string(),
},
- assert: true,
- }],
+ true,
+ )],
time_in_ms: 0,
compressed: false,
}],
@@ -180,13 +180,11 @@ mod tests {
calls: vec![],
captures: vec![],
asserts: vec![],
- errors: vec![Error {
- source_info: SourceInfo::new(1, 5, 1, 19),
- inner: RunnerError::HttpConnection(
- "(6) Could not resolve host: unknown".to_string(),
- ),
- assert: false,
- }],
+ errors: vec![Error::new(
+ SourceInfo::new(1, 5, 1, 19),
+ RunnerError::HttpConnection("(6) Could not resolve host: unknown".to_string()),
+ false,
+ )],
time_in_ms: 0,
compressed: false,
}],
diff --git a/packages/hurl/src/report/junit/testcase.rs b/packages/hurl/src/report/junit/testcase.rs
index d4331c7b619..ea8ad53d5e8 100644
--- a/packages/hurl/src/report/junit/testcase.rs
+++ b/packages/hurl/src/report/junit/testcase.rs
@@ -122,13 +122,13 @@ HTTP/1.0 200
calls: vec![],
captures: vec![],
asserts: vec![],
- errors: vec![Error {
- source_info: SourceInfo::new(2, 10, 2, 13),
- inner: RunnerError::AssertStatus {
+ errors: vec![Error::new(
+ SourceInfo::new(2, 10, 2, 13),
+ RunnerError::AssertStatus {
actual: "404".to_string(),
},
- assert: true,
- }],
+ true,
+ )],
time_in_ms: 0,
compressed: false,
}],
@@ -161,13 +161,11 @@ HTTP/1.0 200
calls: vec![],
captures: vec![],
asserts: vec![],
- errors: vec![Error {
- source_info: SourceInfo::new(1, 5, 1, 19),
- inner: RunnerError::HttpConnection(
- "(6) Could not resolve host: unknown".to_string(),
- ),
- assert: false,
- }],
+ errors: vec![Error::new(
+ SourceInfo::new(1, 5, 1, 19),
+ RunnerError::HttpConnection("(6) Could not resolve host: unknown".to_string()),
+ false,
+ )],
time_in_ms: 0,
compressed: false,
}],
diff --git a/packages/hurl/src/runner/entry.rs b/packages/hurl/src/runner/entry.rs
index 7606d5078a5..2310800951a 100644
--- a/packages/hurl/src/runner/entry.rs
+++ b/packages/hurl/src/runner/entry.rs
@@ -22,7 +22,7 @@ use hurl_core::ast::*;
use crate::http;
use crate::http::ClientOptions;
-use crate::runner::error::{Error, RunnerError};
+use crate::runner::error::Error;
use crate::runner::request::{cookie_storage_clear, cookie_storage_set, eval_request};
use crate::runner::response::{eval_asserts, eval_captures, eval_version_status_asserts};
use crate::runner::result::{AssertResult, EntryResult};
@@ -95,8 +95,7 @@ pub fn run(
start: entry.request.url.source_info.start,
end: entry.request.url.source_info.end,
};
- let inner = RunnerError::from(http_error);
- let error = Error::new(source_info, inner, false);
+ let error = Error::new(source_info, http_error.into(), false);
return EntryResult {
entry_index,
calls: vec![],
diff --git a/packages/hurl/src/runner/filter/html_escape.rs b/packages/hurl/src/runner/filter/html_escape.rs
index f1064fd03ba..6850e79355c 100644
--- a/packages/hurl/src/runner/filter/html_escape.rs
+++ b/packages/hurl/src/runner/filter/html_escape.rs
@@ -31,11 +31,10 @@ pub fn eval_html_escape(
let encoded = html::html_escape(value);
Ok(Some(Value::String(encoded)))
}
- v => Err(Error {
- source_info,
- inner: RunnerError::FilterInvalidInput(v._type()),
- assert,
- }),
+ v => {
+ let inner = RunnerError::FilterInvalidInput(v._type());
+ Err(Error::new(source_info, inner, assert))
+ }
}
}
diff --git a/packages/hurl/src/runner/filter/html_unescape.rs b/packages/hurl/src/runner/filter/html_unescape.rs
index 805b19df49e..52f92a34af5 100644
--- a/packages/hurl/src/runner/filter/html_unescape.rs
+++ b/packages/hurl/src/runner/filter/html_unescape.rs
@@ -31,11 +31,10 @@ pub fn eval_html_unescape(
let decoded = html::html_unescape(value);
Ok(Some(Value::String(decoded)))
}
- v => Err(Error {
- source_info,
- inner: RunnerError::FilterInvalidInput(v._type()),
- assert,
- }),
+ v => {
+ let inner = RunnerError::FilterInvalidInput(v._type());
+ Err(Error::new(source_info, inner, assert))
+ }
}
}
diff --git a/packages/hurl/src/runner/filter/jsonpath.rs b/packages/hurl/src/runner/filter/jsonpath.rs
index 6ff1e02c6d6..28a910ece4b 100644
--- a/packages/hurl/src/runner/filter/jsonpath.rs
+++ b/packages/hurl/src/runner/filter/jsonpath.rs
@@ -32,11 +32,10 @@ pub fn eval_jsonpath(
) -> Result