Constructs an instance of the ErrorManager class.
Optional attemptClear: boolean = trueIndicates whether to attempt to clear errors asynchronously upon initialization.
Optional store: LocalForageAn optional store instance created by the createInstance function.
const errorManager = new ErrorManager(true,
createInstance({ name: ErrorManager.STORE_NAME, driver: INDEXEDDB })
);
Private _errorsErrors that have been thrown.
Private _historyLog of all actions that have been performed.
Private Optional _storeA private property that optionally holds the return type of the createInstance function.
This property is used to store an instance created by the createInstance function.
Static DEBUGA flag indicating whether debug mode is enabled.
When set to true, additional debug information may be logged.
This can be useful for development and troubleshooting purposes.
Static FILE_The file extension used for error reports. This is a constant value set to 'errorReport'.
Static FILE_A constant string that serves as the prefix for error report files. This prefix is used to name the error report files generated by the ErrorManager.
Static PASSWORDStatic STORE_Static STORE_Static Private _instanceErrorManager singleton
Static InstanceGenerate ViewerOverlord singleton
Private _convertPrivate _convertPrivate _downloadPrivate _getGenerates a file name based on the current date and time.
If the DEBUG flag is set to true, it returns 'debug.zip'.
Otherwise, it generates a file name using the current date and time,
replacing all non-alphanumeric characters with underscores.
The generated file name.
Private _getRetrieves the user information.
The user object.
Readonly browserReadonly browserReadonly browserReadonly browserReadonly browserReadonly browserReadonly browserReadonly dataReadonly dataReadonly dataReadonly dataReadonly javaReadonly pageReadonly previousReadonly referrer: stringReadonly scrReadonly scrReadonly sizeReadonly sizeReadonly sizeReadonly sizeReadonly sizeReadonly sizeReadonly sizeReadonly sizeReadonly timeReadonly timezone: numberReadonly zoomPrivate _getPrivate Generates a ZIP file blob containing the user's history, errors, and user information.
A promise that resolves to a Blob representing the ZIP file.
ErrorManager.DEBUG is true, the ZIP file will not be encrypted.ErrorManager.DEBUG is false, the ZIP file will be encrypted with the password specified in ErrorManager.PASSWORD and an encryption strength of 1.If there is an issue creating or adding files to the ZIP.
Private _saveAdds a history object to the history list, saves the history asynchronously, and dispatches a history event.
The history object to be added. Must implement the AbstractHistoryObject interface.
A promise that resolves when the history object has been added and saved.
If the provided object is not a valid history object.
Attempts to clear the errors and history asynchronously.
A promise that resolves to true if the errors and history were cleared,
or false if they were loaded from the store.
If the store is not defined.
The method performs the following steps:
shouldClear.clear and returns true.true.false.Clears the current errors and history from the error manager.
This method will reset the _errors and _history arrays to empty arrays.
It will then update the store with the cleared state.
A promise that resolves when the store has been updated.
If the store is not defined.
Handles an error by performing several actions:
The error object to handle. Must be an instance of AbstractErrorObject.
A promise that resolves to an Error indicating the method is not fully implemented.
Will throw an error if the provided object is not a valid error object.
Exports the error data as a ZIP file.
Optional downloadFile: boolean = trueWhether to download the file after exporting.
A promise that resolves with the file name and the Blob object of the ZIP file.
EVENT_TYPES.EXPORT_BEGIN - Dispatched when the export process begins.
EVENT_TYPES.EXPORT_DONE - Dispatched when the export process is completed.
Protected should
Error manager that handles the application's
errorsand the user'shistory.If the app crashes, the
errorsandhistorywill be exported to a zip file. The zip file will be encrypted with a password. The password is123456789.This means that you, as a developer, can read the
errorsandhistoryof the user. No more guessing or vague descriptions of the error.You can only read the
errorsandhistoryof the user if the user sends you the zip file. The zip file will be saved in thedownloadsfolder of the user's device. The zip file will be namedMyErrorReport_<date>.errorReport.No data will be sent to any server. You need to add that yourself :)