Class OperationException

All Implemented Interfaces:
Serializable

public class OperationException extends BaseException
Exception class for operation-related errors in the Beas Rule Engine.

This class represents exceptions that occur during business operations such as rule execution, data processing, and system operations. It extends BaseException to provide enhanced error handling capabilities.

Key features include:

  • HTTP status code integration
  • Error code management
  • Stack trace filtering for JSON serialization
  • Detailed error information
Since:
1.0
Version:
1.0
Author:
Beas Solution Team
See Also:
  • Constructor Details

    • OperationException

      public OperationException(Throwable e)
      Constructor that wraps an existing throwable.
      Parameters:
      e - The throwable to wrap
    • OperationException

      public OperationException(String message, org.springframework.http.HttpStatus status, Throwable e)
      Constructor with message, HTTP status, and cause.
      Parameters:
      message - The error message
      status - The HTTP status code
      e - The cause of the exception
    • OperationException

      public OperationException(String message, org.springframework.http.HttpStatus status)
      Constructor with message and HTTP status.
      Parameters:
      message - The error message
      status - The HTTP status code
    • OperationException

      public OperationException(String message)
      Constructor with message only.

      This constructor creates an exception with the specified message and sets the HTTP status to INTERNAL_SERVER_ERROR.

      Parameters:
      message - The error message
  • Method Details

    • getStackTrace

      public StackTraceElement[] getStackTrace()
      Overrides getStackTrace to exclude it from JSON serialization.

      This method is marked with @JsonIgnore to prevent stack trace information from being included in JSON responses for security reasons.

      Overrides:
      getStackTrace in class Throwable
      Returns:
      The stack trace elements
    • getErrorDetail

      public String getErrorDetail()
      Gets detailed error information as a string.

      This method returns a string representation of the error details, including the first line of the stack trace for debugging purposes.

      Returns:
      String containing error details