Class ErrorHandler
java.lang.Object
utils.ErrorHandler
Centralized error and logging helper used across the UI and utilities.
This class configures a file-based
Logger and
exposes convenience methods to log at common levels. It also provides a
helper to display user-facing error dialogs while ensuring the technical
details are written to the log file.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent instantiation of this utility class. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidLog a severe error with an exception.static voidLog an informational message.static voidlogWarning(String message) Log a warning message.static voidshowErrorToUser(String userMessage, String technicalDetails) Show a user-facing error dialog while logging technical details to the configured log file.
-
Field Details
-
logger
Logger used for application diagnostics and error recording.
-
-
Constructor Details
-
ErrorHandler
private ErrorHandler()Private constructor to prevent instantiation of this utility class.
-
-
Method Details
-
logError
-
logWarning
Log a warning message.- Parameters:
message- warning text
-
logInfo
Log an informational message.- Parameters:
message- info text
-
showErrorToUser
Show a user-facing error dialog while logging technical details to the configured log file. This should be used for errors that require user attention.- Parameters:
userMessage- message shown to the usertechnicalDetails- technical details recorded in logs
-