public class CustomException extends RuntimeException
Modifier and Type | Field and Description |
---|---|
protected StackTraceElement[] |
actualTrace
The actual trace.
|
Constructor and Description |
---|
CustomException(String msg)
Instantiates a new custom exception.
|
CustomException(String message,
org.springframework.http.HttpStatus errorCode,
StackTraceElement[] actualTrace)
Instantiates a new custom exception.
|
CustomException(String msg,
Throwable throwable)
Instantiates a new custom exception.
|
CustomException(Throwable throwable)
Instantiates a new custom exception.
|
Modifier and Type | Method and Description |
---|---|
StackTraceElement[] |
getActualTrace()
Gets the actual trace.
|
org.springframework.http.HttpStatus |
getErrorCode()
Gets the error code.
|
String |
getErrorMessage()
Gets the error message.
|
void |
setActualTrace(StackTraceElement[] actualTrace)
Sets the actual trace.
|
void |
setErrorCode(org.springframework.http.HttpStatus errorCode)
Sets the error code.
|
void |
setErrorMessage(String errorMessage)
Sets the error message.
|
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
protected StackTraceElement[] actualTrace
public CustomException(Throwable throwable)
throwable
- the throwablepublic CustomException(String msg, Throwable throwable)
msg
- the msgthrowable
- the throwablepublic CustomException(String msg)
msg
- the msgpublic CustomException(String message, org.springframework.http.HttpStatus errorCode, StackTraceElement[] actualTrace)
message
- the messageerrorCode
- the error codeactualTrace
- the actual tracepublic StackTraceElement[] getActualTrace()
public void setActualTrace(StackTraceElement[] actualTrace)
actualTrace
- the new actual tracepublic void setErrorCode(org.springframework.http.HttpStatus errorCode)
errorCode
- the new error codepublic org.springframework.http.HttpStatus getErrorCode()
public void setErrorMessage(String errorMessage)
errorMessage
- the new error messagepublic String getErrorMessage()
Copyright © 2021. All rights reserved.