ConfigurationException
- Namespace:
PPDS.Dataverse.Configuration - Assembly:
PPDS.Dataverse - Kind: Class
- Base:
Exception - Implements:
ISerializable
Summary
Exception thrown when Dataverse configuration is invalid. Provides detailed context including property name, connection name, environment name, and resolution hints showing where the property can be configured.
Members
Constructors
ConfigurationException(string connectionName, string propertyName, string message)
ConfigurationException(string connectionName, string propertyName, string message)
Initializes a new instance of the PPDS.Dataverse.Configuration.ConfigurationException class.
ConfigurationException(string message)
ConfigurationException(string message)
Initializes a new instance of the PPDS.Dataverse.Configuration.ConfigurationException class.
ConfigurationException(string message, Exception innerException)
ConfigurationException(string message, Exception innerException)
Initializes a new instance of the PPDS.Dataverse.Configuration.ConfigurationException class.
Methods
InvalidValue
ConfigurationException InvalidValue(string connectionName, string propertyName, string reason)
Creates an exception for an invalid property value.
MissingRequired
ConfigurationException MissingRequired(string connectionName, string propertyName)
Creates an exception for a missing required property.
MissingRequiredWithHints
ConfigurationException MissingRequiredWithHints(string propertyName, string connectionName, int connectionIndex, string environmentName, string sectionName)
Creates an exception for a missing required property with full context and resolution hints.
-
Param
propertyName: The name of the missing property (e.g., "Url", "ClientId"). -
Param
connectionName: The connection name (e.g., "Primary", "Secondary"). -
Param
connectionIndex: The zero-based index of the connection in the configuration array. -
Param
environmentName: The environment name, or null for root-level configurations. -
Param
sectionName: The configuration section name (default: "Dataverse"). -
Returns: A ConfigurationException with formatted message and resolution hints.
NoConnectionsConfigured
ConfigurationException NoConnectionsConfigured(string environmentName, string sectionName)
Creates an exception for when no connections are configured.
-
Param
environmentName: The environment name, or null for root-level configurations. -
Param
sectionName: The configuration section name (default: "Dataverse").
SecretResolutionFailed
ConfigurationException SecretResolutionFailed(string connectionName, string propertyName, string source, Exception innerException)
Creates an exception for a secret resolution failure.
Properties
ConnectionIndex
Nullable<int> ConnectionIndex { get; }
Gets the index of the connection in the configuration array.
ConnectionName
string ConnectionName { get; }
Gets the name of the connection that has invalid configuration.
EnvironmentName
string EnvironmentName { get; }
Gets the name of the environment where the configuration error occurred. Null for root-level (single-environment) configurations.
Message
string Message { get; }
Gets the formatted message including resolution hints.
PropertyName
string PropertyName { get; }
Gets the name of the property that is invalid.
ResolutionHints
IReadOnlyList<string> ResolutionHints { get; }
Gets the configuration paths where the property can be set, in order of precedence.