|
|
|
@ -235,16 +235,14 @@ func RespAsErrorCompatible(resp *resty.Response) error { |
|
|
|
|
|
|
|
// DeferDo a common defer do used in dtmcli/dtmgrpc
|
|
|
|
func DeferDo(rerr *error, success func() error, fail func() error) { |
|
|
|
defer func() { |
|
|
|
if x := recover(); x != nil { |
|
|
|
_ = fail() |
|
|
|
panic(x) |
|
|
|
} else if *rerr != nil { |
|
|
|
_ = fail() |
|
|
|
} else { |
|
|
|
*rerr = success() |
|
|
|
} |
|
|
|
}() |
|
|
|
if x := recover(); x != nil { |
|
|
|
_ = fail() |
|
|
|
panic(x) |
|
|
|
} else if *rerr != nil { |
|
|
|
_ = fail() |
|
|
|
} else { |
|
|
|
*rerr = success() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Escape solve CodeQL reported problem
|
|
|
|
|