title: How to verify exception thrown using StepVerifier in project reactor
body: <pre><code>    def expectError() {
  
          StepVerifier.create(readDB())
                      .expectError(RuntimeException.class)
                      .verify();
      }
  
       private Mono&lt;String&gt; readDB() {
  //        try {
              return Mono.just(externalService.get())
                      .onErrorResume(throwable -&gt; Mono.error(throwable));
  
  //        } catch (Exception e) {
  //            return Mono.error(e);
  //        }
      }
  
  </code></pre>
  
  <p>unable to make it work if externalService.get throws Exception instead of return Mono.error. Is is always recommended to transform to Mono/Flow using try catch or is there any better way to verify such thrown exception?</p>