mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
revert assertCustom
This commit is contained in:
parent
2f2501ec5b
commit
c1dca54666
@ -76,7 +76,7 @@ func ExpiredSessionError() *HandlerError {
|
||||
// An optional debugContext map can be provided. If it is present and sentry is configured,
|
||||
// it is added as context to the sentry events generated for failed assertions.
|
||||
func Assert(msg string, expr bool, debugContext ...map[string]interface{}) {
|
||||
assertCustom(msg, expr)
|
||||
assert(msg, expr)
|
||||
if !expr {
|
||||
sentry.WithScope(func(scope *sentry.Scope) {
|
||||
if len(debugContext) > 0 {
|
||||
@ -90,13 +90,13 @@ func Assert(msg string, expr bool, debugContext ...map[string]interface{}) {
|
||||
// AssertWithContext is a version of Assert that associates any sentry events with a
|
||||
// request context.
|
||||
func AssertWithContext(ctx context.Context, msg string, expr bool) {
|
||||
assertCustom(msg, expr)
|
||||
assert(msg, expr)
|
||||
if !expr {
|
||||
GetSentryHubFromContextOrDefault(ctx).CaptureException(fmt.Errorf("assertion failed: %s", msg))
|
||||
}
|
||||
}
|
||||
|
||||
func assertCustom(msg string, expr bool) {
|
||||
func assert(msg string, expr bool) {
|
||||
if expr {
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user