@Test
public void testErrorHandlingWithoutUserError() {

  InvalidLoggingScopeStateException e =
      assertThrows(InvalidLoggingScopeStateException.class, () -> ERROR_CONTEXT.run(() -> {}));
  assertThat(e).hasCauseThat().isInstanceOf(IllegalArgumentException.class);
  assertThat(e).hasCauseThat().hasMessageThat().isEqualTo("BAD CONTEXT");
}