diff --git a/src/core/Akka.Coordination/LeaseProvider.cs b/src/core/Akka.Coordination/LeaseProvider.cs index 5f3df3b0fb1..0aeb012b1d8 100644 --- a/src/core/Akka.Coordination/LeaseProvider.cs +++ b/src/core/Akka.Coordination/LeaseProvider.cs @@ -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, @@ -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; + } }); } }