'how to resolve error throws alternative exception from catch block without history

I am trying to catch 3 different types of exceptions and my code is something like this

 if (condition) {
        return result;
      } else {
        throw new RuntimeException(
                "Error1");
      }
    } catch (WebApplicationException e) {
      throw new QppApiClientException(e);
    } catch (IOException e) {
      throw new RuntimeException("Error2: " + e);
    }

and I am getting this error

throws alternative exception from catch block without history



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source