Refact, use std::io::Error::from_raw_os_error() to format message
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
c85682de8d
commit
c6d587f0c7
2 changed files with 26 additions and 8 deletions
|
|
@ -1738,11 +1738,11 @@ pub fn create_process_with_logon(user: &str, pwd: &str, exe: &str, arg: &str) ->
|
|||
{
|
||||
let last_error = GetLastError();
|
||||
bail!(
|
||||
"CreateProcessWithLogonW failed : \"{}\", errno={}",
|
||||
"CreateProcessWithLogonW failed : \"{}\", error {:?}",
|
||||
last_error_table
|
||||
.get(&last_error)
|
||||
.unwrap_or(&"Unknown error"),
|
||||
last_error
|
||||
io::Error::from_raw_os_error(last_error as _)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue