diff --git a/exceptions/Exception.go b/exceptions/Exception.go index aab0937..e0c6f8c 100644 --- a/exceptions/Exception.go +++ b/exceptions/Exception.go @@ -83,3 +83,10 @@ func Print(err error) { PrintStackTraceByArray(os.Stderr, GetStackTrace()) } } + +func Package(err error) Exception { + if err == nil { + return nil + } + return NewRuntimeException(err, "", true, err) +} diff --git a/exceptions/RuntimeException.go b/exceptions/RuntimeException.go index 5bcfb01..3184b3b 100644 --- a/exceptions/RuntimeException.go +++ b/exceptions/RuntimeException.go @@ -14,14 +14,6 @@ type RuntimeException struct { cause Exception } -func Package(err error) *RuntimeException { - if err == nil { - return nil - } - runtimeException := NewRuntimeException(err, "", true, err) - return &runtimeException -} - func NewRuntimeException(message interface{}, exceptionMessage string, getStackTrace bool, cause interface{}) RuntimeException { var stackTrace []StackTrace = nil if getStackTrace {