java.lang.Object
pl.polsl.rtsa.controller.ErrorHandler
Unified error handler for the UI layer.
Translates backend exceptions to user-friendly Polish messages and updates the UI status label appropriately.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConverts exception to user-friendly Polish message.static voidHandles any exception, updating the status label appropriately.
-
Field Details
-
logger
private static final org.slf4j.Logger logger
-
-
Constructor Details
-
ErrorHandler
public ErrorHandler()
-
-
Method Details
-
handle
Handles any exception, updating the status label appropriately. Safe to call from any thread - automatically dispatches to JavaFX thread.- Parameters:
e- The exception to handle.statusLabel- The label to update with error message.
-
getUserMessage
Converts exception to user-friendly Polish message.- Parameters:
e- The exception to convert.- Returns:
- User-friendly error message in Polish.
-