It is possible, to display generic error messages above the currently displayed page.
The master page checks the state for a configurable key.
If no key is configured, the fallback validationErrorData is used.
If a value is added to this state key, the message gets displayed. To remove the message, set the key to an undefined/empty value. All values from these keys are translated with ngx-translate.
In combination with the service activators, a response can be written to the state and displayed as a validation message.
Use the serviceActivatorErrorHandlingExcludeStatusCodes configuration in the AppConfiguration PfeConfig to define http status codes that should not be treated as an error that redirects to the error page.
The PFE supports multiple different URL parameters.
These can be used to switch the tenant/applicationId, to supply a state ID or to transfer parameters into the state.
The configuration is located in the pfeConfig within the application config (usually application.json or pfe.json).
For example:
Example :"pfeConfig": {
"urlParametersInState": [
{
"key": "myCustomURLParameter",
"stateKeyExpression": "$.myCustomURLParameterInTheState"
},
{
"key": "anotherParameter",
"stateKeyExpression": "$.savedInTheState"
}
]
},PFE's internal logging goes through the PFE_LOGGER injection token (PfeLogger interface: debug/info/warn/error).
By default it logs to the console when Angular runs in dev mode and is a silent no-op otherwise (production), with no config flag to change that behavior.
To change the default behaviour, for example to forward them to a remote logging backend, override the token with your own implementation:
Example :
import { PFE_LOGGER } from '@allianz/ngx-pfe';
providers: [
{
provide: PFE_LOGGER,
useValue: {
debug: (message, ...params) => { /* ... */ },
info: (message, ...params) => { /* ... */ },
warn: (message, ...params) => { /* ... */ },
error: (message, ...params) => { /* ... */ },
},
},
],