update RuntimeException

This commit is contained in:
tursom 2021-05-21 14:48:42 +08:00
parent de50ffca8b
commit 6a6700c811
2 changed files with 7 additions and 8 deletions

View File

@ -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)
}

View File

@ -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 {