From 14f0481066ade931baf9791626b2cda165c0f4f2 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 7 Feb 2025 00:03:46 -0500 Subject: Add server error to EnterpriseCheckoutError::RefreshExpiredLicenseFailed --- rust/src/enterprise.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'rust/src') diff --git a/rust/src/enterprise.rs b/rust/src/enterprise.rs index 6a4088dc..ad682aad 100644 --- a/rust/src/enterprise.rs +++ b/rust/src/enterprise.rs @@ -15,8 +15,8 @@ pub enum EnterpriseCheckoutError { NoPassword, #[error("failed to authenticate with username and password")] NotAuthenticated, - #[error("failed to refresh expired license")] - RefreshExpiredLicenseFailed, + #[error("failed to refresh expired license: {0}")] + RefreshExpiredLicenseFailed(String), } /// Initialize the enterprise server connection to check out a floating license. @@ -67,7 +67,10 @@ pub fn checkout_license(duration: Duration) -> Result<(), EnterpriseCheckoutErro { // If the license is expired we should refresh the license. if !update_server_license(duration) { - return Err(EnterpriseCheckoutError::RefreshExpiredLicenseFailed); + let last_error = server_last_error().to_string(); + return Err(EnterpriseCheckoutError::RefreshExpiredLicenseFailed( + last_error, + )); } } -- cgit v1.3.1