Skip to content

Commit

Permalink
[PORT #6201] Revert ConfigurationException due to binary incompatibil…
Browse files Browse the repository at this point in the history
…ity (#6204)

* Revert ConfigurationException due to binary incompatibility (#6201)

* Revert ConfigurationException due to binary incompatibility

* Update API Verify list

(cherry picked from commit 90dde25)

* Update API Verify list
  • Loading branch information
Arkatufus committed Oct 20, 2022
1 parent b45065e commit ec2d4ba
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Expand Up @@ -2206,7 +2206,7 @@ namespace Akka.Configuration
public ConfigurationException(string message) { }
public ConfigurationException(string message, System.Exception exception) { }
protected ConfigurationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null, string reason = null) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null) { }
}
public class ConfigurationFactory
{
Expand Down
Expand Up @@ -2208,7 +2208,7 @@ namespace Akka.Configuration
public ConfigurationException(string message) { }
public ConfigurationException(string message, System.Exception exception) { }
protected ConfigurationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null, string reason = null) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null) { }
}
public class ConfigurationFactory
{
Expand Down
Expand Up @@ -2206,7 +2206,7 @@ namespace Akka.Configuration
public ConfigurationException(string message) { }
public ConfigurationException(string message, System.Exception exception) { }
protected ConfigurationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null, string reason = null) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null) { }
}
public class ConfigurationFactory
{
Expand Down
Expand Up @@ -2239,7 +2239,7 @@ namespace Akka.Configuration
public ConfigurationException(string message) { }
public ConfigurationException(string message, System.Exception exception) { }
protected ConfigurationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null, string reason = null) { }
public static Akka.Configuration.ConfigurationException NullOrEmptyConfig<T>(string path = null) { }
}
public class ConfigurationFactory
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster/ClusterSettings.cs
Expand Up @@ -35,7 +35,7 @@ public ClusterSettings(Config config, string systemName)
//TODO: Requiring!
var clusterConfig = config.GetConfig("akka.cluster");
if (clusterConfig?.GetConfig("failure-detector") == null)
throw ConfigurationException.NullOrEmptyConfig<ClusterSettings>("akka.cluster", "Did you forgot to set the 'akka.cluster.provider' HOCON property to 'cluster'?");
throw new ConfigurationException($"Failed to instantiate {nameof(ClusterSettings)}: Configuration does not contain `akka.cluster` node. Did you forgot to set the 'akka.cluster.provider' HOCON property to 'cluster'?");

LogInfoVerbose = clusterConfig.GetBoolean("log-info-verbose", false);
LogInfo = LogInfoVerbose || clusterConfig.GetBoolean("log-info", false);
Expand Down
6 changes: 3 additions & 3 deletions src/core/Akka/Configuration/ConfigurationException.cs
Expand Up @@ -16,11 +16,11 @@ namespace Akka.Configuration
/// </summary>
public class ConfigurationException : AkkaException
{
public static ConfigurationException NullOrEmptyConfig<T>(string path = null, string reason = null)
public static ConfigurationException NullOrEmptyConfig<T>(string path = null)
{
if (!string.IsNullOrWhiteSpace(path))
return new ConfigurationException($"Failed to instantiate {typeof(T).Name}: Configuration does not contain `{path}` node{(reason != null ? $". {reason}" : "")}");
return new ConfigurationException($"Failed to instantiate {typeof(T).Name}: Configuration is null or empty{(reason != null ? $". {reason}" : "")}");
return new ConfigurationException($"Failed to instantiate {typeof(T).Name}: Configuration does not contain `{path}` node");
return new ConfigurationException($"Failed to instantiate {typeof(T).Name}: Configuration is null or empty");
}

/// <summary>
Expand Down

0 comments on commit ec2d4ba

Please sign in to comment.