Skip to content

Commit 14f0481

Browse files
committed
Add server error to EnterpriseCheckoutError::RefreshExpiredLicenseFailed
1 parent ce77933 commit 14f0481

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rust/src/enterprise.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub enum EnterpriseCheckoutError {
1515
NoPassword,
1616
#[error("failed to authenticate with username and password")]
1717
NotAuthenticated,
18-
#[error("failed to refresh expired license")]
19-
RefreshExpiredLicenseFailed,
18+
#[error("failed to refresh expired license: {0}")]
19+
RefreshExpiredLicenseFailed(String),
2020
}
2121

2222
/// Initialize the enterprise server connection to check out a floating license.
@@ -67,7 +67,10 @@ pub fn checkout_license(duration: Duration) -> Result<(), EnterpriseCheckoutErro
6767
{
6868
// If the license is expired we should refresh the license.
6969
if !update_server_license(duration) {
70-
return Err(EnterpriseCheckoutError::RefreshExpiredLicenseFailed);
70+
let last_error = server_last_error().to_string();
71+
return Err(EnterpriseCheckoutError::RefreshExpiredLicenseFailed(
72+
last_error,
73+
));
7174
}
7275
}
7376

0 commit comments

Comments
 (0)