mirror of
https://github.com/tursom/GoCollections.git
synced 2026-08-19 13:33:29 +08:00
update NewRuntimeException
This commit is contained in:
@@ -80,5 +80,6 @@ func Print(err error) {
|
||||
err.(Exception).PrintStackTrace()
|
||||
default:
|
||||
_, _ = fmt.Fprintln(os.Stderr, err)
|
||||
PrintStackTraceByArray(os.Stderr, GetStackTrace())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user