Skip to content

Commit

Permalink
Fix LeaseProvider instance Activator exception handling (#5838)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Apr 13, 2022
1 parent 37e6331 commit 8fec4ba
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/core/Akka.Coordination/LeaseProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ public Lease GetLease(string leaseName, string configPath, string ownerName)
{
return (Lease)Activator.CreateInstance(leaseType, settings, _system);
}
catch
catch(MissingMethodException)
{
return (Lease)Activator.CreateInstance(leaseType, settings);
}
}
catch (Exception ex)
catch (MissingMethodException ex)
{
Log.Error(
ex,
Expand All @@ -159,6 +159,17 @@ public Lease GetLease(string leaseName, string configPath, string ownerName)
throw;
}
catch(Exception ex)
{
Log.Error(
ex,
"Failed to instantiate lease class [{2}] for leaseName [{0}], configPath [{1}].",
settings.LeaseName,
configPath,
leaseType);
throw;
}
});
}
}
Expand Down

0 comments on commit 8fec4ba

Please sign in to comment.