Class OperationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.beassolution.rule.exception.base.BaseException
com.beassolution.rule.exception.OperationException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionOperationException
(String message) Constructor with message only.OperationException
(String message, org.springframework.http.HttpStatus status) Constructor with message and HTTP status.OperationException
(String message, org.springframework.http.HttpStatus status, Throwable e) Constructor with message, HTTP status, and cause.Constructor that wraps an existing throwable. -
Method Summary
Modifier and TypeMethodDescriptionGets detailed error information as a string.Overrides getStackTrace to exclude it from JSON serialization.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OperationException
Constructor that wraps an existing throwable.- Parameters:
e
- The throwable to wrap
-
OperationException
-
OperationException
Constructor with message and HTTP status.- Parameters:
message
- The error messagestatus
- The HTTP status code
-
OperationException
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
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 classThrowable
- Returns:
- The stack trace elements
-
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
-