get_response: print process stderr as warnings
This commit is contained in:
parent
237959fb42
commit
badc42a7e2
13
src/main.rs
13
src/main.rs
|
@ -11,7 +11,7 @@ use std::thread;
|
||||||
extern crate clap;
|
extern crate clap;
|
||||||
|
|
||||||
use chrono::offset::TimeZone;
|
use chrono::offset::TimeZone;
|
||||||
use log::{debug, error, info};
|
use log::{debug, error, info, warn};
|
||||||
use openssl::{asn1, ssl, x509};
|
use openssl::{asn1, ssl, x509};
|
||||||
|
|
||||||
/// General CGI configuration.
|
/// General CGI configuration.
|
||||||
|
@ -346,6 +346,17 @@ fn get_response(
|
||||||
cgi_error.to_owned()
|
cgi_error.to_owned()
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
if output.stderr.len() > 0 {
|
||||||
|
warn!("Process standard error:");
|
||||||
|
if let Ok(stderr) = std::str::from_utf8(output.stderr.as_slice()) {
|
||||||
|
for line in stderr.lines() {
|
||||||
|
warn!(" {}", line);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
error!("Can't decode process standard error.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok((url_str.to_string(), output.stdout))
|
Ok((url_str.to_string(), output.stdout))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue