...
Today, the error indicator is populated with a String representing an error that will be presented as is at the Data Import logs in the FOLIO UI. When appropriate an error object is populated instead of a string. The error object will have properties at minimum:
code
: Error code for the user facing errormessage
: user facing error message that should include the code. Message should be descriptive enough to aid in issue resolution.cause
: "ugly" java exceptions as seen today, most likely containing stacktraces
...
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Source Record Manager(SRM)
...
Info |
---|
The FOLIO UI can be modified to show the system error via extra clicks of UI controls around the user-friendly message. |
SRM should be backward-compatible with scenarios that cannot generate user-friendly errors. This can be achieved through the following decision tree:
If a string value is encountered in the error indicator of a Data Import Event Payload, store this value in the
error
property of the journal record. In this case, the "system_error" property will remain empty.If an Error Object is encountered in the error indicator of a Data Import Event Payload, store the
message
property of the Error Object in theerror
property of the journal record. Then, store the "cause" property of the Error Object in thesystem_error
property of the journal record.
Error Code Persistence
Error codes and their corresponding messages will be stored in property files inside the Domain Owning Module. If the module is written in Java, these property files should be placed in the Resources folder of the FOLIO module. This arrangement will enable the use of ResourceBundle for obtaining future translations. It will also centralize messages in one location for regular review and minimize code collisions. Example:
Code Block | ||
---|---|---|
| ||
000=Internal Error 001=Item not found |
...