title: How to pass HTTP status code from service to controller in quarkus?
body: <p>I am trying to connect to a third-party API from quarkus controller . I have a controller using the method of service.</p>
  <p>Controller</p>
  <pre><code>package com.ncr.invoice;
  
  // all imports over here 
  
  @Path(&quot;/api&quot;)
  @RequestScoped
  public class InvoiceController {
      // all variable and injection 
      @POST
      @Consumes(MediaType.APPLICATION_JSON)
      @Produces(MediaType.APPLICATION_JSON)
      @Path(&quot;/invoice&quot;)
      @Timeout(250)
      @PermitAll
      public Response getInvoice(AuthTokenRequestModel atrm){
              SoupResponseInvoiceDetail srid = null;
              try{
                   srid = service.getInvoice(
                      atrm.getMcn(),&quot;transactionId&quot;, atrm.getInvoiceNumber()
                   );
                   LOG.info(&quot;try block end&quot;);
              }
              catch(InterruptedException e)
              {
                  LOG.info(&quot;Over here&quot;);
                  return Response.status(401).build();
              }
            
              return Response.ok(srid).build();
          }
  
          return Response.status(401).build();
      }
  
   
      // all getter setter 
  }
  </code></pre>
  <p>service</p>
  <pre><code>@Path(&quot;/&quot;)
  @RegisterRestClient(configKey=&quot;invoice-api&quot;)
  public interface InvoiceService {
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      @Path(&quot;/&quot;)
      public SoupResponseInvoiceDetail getInvoice(@QueryParam(&quot;id&quot;) String id,@QueryParam(&quot;txn_id&quot;) String txnId, @QueryParam(&quot;invoice&quot;) String invoice) throws InterruptedException;
  
     
  }
  </code></pre>
  <p>How to return the HTTP status code from service to controller?
  I need to look into the response body when http status is 500</p>