Class ErrorHandler

java.lang.Object
pl.polsl.rtsa.controller.ErrorHandler

public class ErrorHandler extends Object
Unified error handler for the UI layer.

Translates backend exceptions to user-friendly Polish messages and updates the UI status label appropriately.

  • Field Details

    • logger

      private static final org.slf4j.Logger logger
  • Constructor Details

    • ErrorHandler

      public ErrorHandler()
  • Method Details

    • handle

      public static void handle(Exception e, javafx.scene.control.Label statusLabel)
      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

      public static String getUserMessage(Exception e)
      Converts exception to user-friendly Polish message.
      Parameters:
      e - The exception to convert.
      Returns:
      User-friendly error message in Polish.