update NewRuntimeException

This commit is contained in:
2021-05-21 13:52:31 +08:00
parent dbcc45a943
commit de50ffca8b
2 changed files with 9 additions and 0 deletions

View File

@@ -80,5 +80,6 @@ func Print(err error) {
err.(Exception).PrintStackTrace()
default:
_, _ = fmt.Fprintln(os.Stderr, err)
PrintStackTraceByArray(os.Stderr, GetStackTrace())
}
}

View File

@@ -14,6 +14,14 @@ 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 {