mirror of
https://github.com/tursom/GoCollections.git
synced 2025-01-14 13:00:40 +08:00
add PackagePanic
This commit is contained in:
parent
d257299449
commit
eab2d2eeaa
@ -106,3 +106,20 @@ func PackageAny(err interface{}) Exception {
|
||||
return NewRuntimeException(err, "", true, nil)
|
||||
}
|
||||
}
|
||||
|
||||
func PackagePanic(panic interface{}) Exception {
|
||||
switch panic.(type) {
|
||||
case error:
|
||||
return NewRuntimeException(
|
||||
panic,
|
||||
"an panic caused on handle WebSocket message:",
|
||||
true, panic,
|
||||
)
|
||||
default:
|
||||
return NewRuntimeException(
|
||||
panic,
|
||||
"an panic caused on handle WebSocket message:",
|
||||
true, nil,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user