Class LocalizedException
Base class for exceptions that carry a localizable user-facing message. Subclasses override GetLocalizedMessage(CultureInfo) to resolve translations. The constructor receives only a localization key; the default culture resource file is the source of strings.
Implements
Inherited Members
Namespace: Zaya.Primitives
Assembly: Zaya.Primitives.dll
Syntax
public class LocalizedException : Exception, ISerializable
Constructors
| Edit this page View SourceLocalizedException(string)
Initializes a new instance of the LocalizedException class.
Declaration
protected LocalizedException(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | Localization resource key (e.g. "Ocr_Err_SnippingToolNotFound"). |
Methods
| Edit this page View SourceGetLocalizedMessage(CultureInfo)
Returns the user-facing localized message for the specified culture. The base implementation returns the key as a fallback. Override to resolve via a resource manager.
Declaration
public virtual string GetLocalizedMessage(CultureInfo culture)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | culture | The target culture for localization. |
Returns
| Type | Description |
|---|---|
| string | The localized error message. |