Skip to content

Commit

Permalink
Merge pull request #22 from agorapulse/feature/flush-sentry-from-log-…
Browse files Browse the repository at this point in the history
…error

wait until Sentry is flushed from @logerror interceptor
  • Loading branch information
musketyr committed Apr 1, 2022
2 parents bd44a87 + 7e4f4cb commit 3e8912c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.micronaut.aop.MethodInterceptor;
import io.micronaut.aop.MethodInvocationContext;
import io.micronaut.core.annotation.AnnotationValue;
import io.sentry.Sentry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -47,6 +48,8 @@ public Object intercept(MethodInvocationContext<Object, Object> context) {
}
}
throw th;
} finally {
Sentry.flush(1000);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import static com.github.stefanbirkner.systemlambda.SystemLambda.*

class LogErrorInterceptorSpec extends Specification {

private static final String LOGGED_EVENT = 'ERROR ThrowsIllegalArgumentTester:44 - Exception executing method'
private static final String LOGGED_EVENT = 'ERROR ThrowsIllegalArgumentTester:45 - Exception executing method'

@AutoCleanup ApplicationContext context = ApplicationContext.run()

Expand Down

0 comments on commit 3e8912c

Please sign in to comment.