Namespace ZhEaIsNsAaBn.Utilities
Classes
CommonErrors
Predefined errors shared by every ZhEaIsNsAaBn package.
Error
A coded error carried by LayerResponse. Code is the stable key clients read; Message is English for developers and logs. Text for users comes from LocalizedMessage, which the API edge fills in the request's language (IErrorLocalizer). Exception and AdditionalData are kept for logs only.
ErrorLocalizer
The default IErrorLocalizer. For each culture from the wanted one up to its neutral parent (ar-EG →
ar) it asks every IErrorMessageSource in order (the app's first, so apps can override package texts); then the
sources' neutral (English) text; then Message. Named placeholders ({Field}) are filled from
Arguments, formatted for the wanted culture; unknown ones stay as written.
LayerResponse
The result of a fallible operation with no value: either success, or failure with one or more Errors (STYLE_GUIDE §3). Return an Error or a list of them directly; implicit conversions build the response.
LayerResponse<TResult>
The result of a fallible operation that returns a value: success with Result, or failure with
Errors. return value;, return error; and return ex; all convert implicitly.
LocalizedMessage
An error message in one language, safe to show users. Produced by IErrorLocalizer and carried on LocalizedMessage.
ResourceErrorMessageSource
Reads error messages from .resx files: resource name = Code. The neutral file (Errors.resx) holds
English; each language adds its own (Errors.ar.resx, Errors.fr.resx).
Severity
Severity.SeverityJsonConverter
Reads/writes a Severity as a plain JSON string.
Interfaces
IErrorLocalizer
Turns an Error into a message for users in one language. Used once, at the edge (API response, UI); library code never localizes.
IErrorMessageSource
A store of translated error messages keyed by Code — usually one package's .resx files
(ResourceErrorMessageSource), but any store works (database, JSON).
Enums
NotifyMode
How an error should be reported. Values match the old Notify.Mode indexes.
NotifyPriority
How urgently an error should be reported. Values match the old Notify.Priority indexes.