File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " oxybox"
3- version = " 1.0.2 "
3+ version = " 1.0.3 "
44authors = [" Thomas Luijken" ]
55categories = [" command-line-utilities" ]
66description = " A drop in replacement for blackbox exporter for Prometheus, with support for TLS and HTTP/3."
Original file line number Diff line number Diff line change 11pub mod probe;
22pub mod result;
3+
4+ use std:: fmt:: Write ;
5+
6+ fn report ( mut err : & ( dyn std:: error:: Error + ' static ) ) -> String {
7+ let mut s = format ! ( "{}" , err) ;
8+ while let Some ( src) = err. source ( ) {
9+ let _ = write ! ( s, "\n \n Caused by: {}" , src) ;
10+ err = src;
11+ }
12+ s
13+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use tokio_native_tls::TlsConnector as TokioTlsConnector;
1010use x509_parser:: parse_x509_certificate;
1111
1212use crate :: config:: probe_config:: { OrganisationConfig , TargetConfig } ;
13+ use crate :: http_probe:: report;
1314use crate :: mimir:: client:: send_to_mimir;
1415use crate :: mimir:: create_probe_metrics;
1516
@@ -201,7 +202,8 @@ async fn probe_url(
201202 )
202203 }
203204 Err ( e) => {
204- log:: error!( "HTTP request failed for URL {url}: {e}" ) ;
205+ let error = report ( & e) ;
206+ log:: error!( "HTTP request failed for URL {url}: {error}" ) ;
205207 return Err ( format ! ( "HTTP request failed for URL {url}: {e}" ) ) ;
206208 }
207209 } ;
You can’t perform that action at this time.
0 commit comments