diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/error.rs b/src/error.rs index 48abdc1..6615753 100644 --- a/src/error.rs +++ b/src/error.rs @@ -73,7 +73,14 @@ impl Error { #[inline] pub fn raw_os_error(self) -> Option<i32> { if self.0.get() < Self::INTERNAL_START { - Some(self.0.get() as i32) + match () { + #[cfg(target_os = "solid_asp3")] + // On SOLID, negate the error code again to obtain the original + // error code. + () => Some(-(self.0.get() as i32)), + #[cfg(not(target_os = "solid_asp3"))] + () => Some(self.0.get() as i32), + } } else { None } @@ -162,7 +169,7 @@ fn internal_desc(error: Error) -> Option<&'static str> { Error::WINDOWS_RTL_GEN_RANDOM => Some("RtlGenRandom: Windows system function failure"), Error::FAILED_RDRAND => Some("RDRAND: failed multiple times: CPU issue likely"), Error::NO_RDRAND => Some("RDRAND: instruction not supported"), - Error::WEB_CRYPTO => Some("Web API self.crypto is unavailable"), + Error::WEB_CRYPTO => Some("Web Crypto API is unavailable"), Error::WEB_GET_RANDOM_VALUES => Some("Web API crypto.getRandomValues is unavailable"), Error::VXWORKS_RAND_SECURE => Some("randSecure: VxWorks RNG module is not initialized"), Error::NODE_CRYPTO => Some("Node.js crypto module is unavailable"), |