code is being executed even when catch block has been called
<p>I have this method .
The issue is that when this condition is met </p>

<pre><code>if (bagList==null||bagList.size()&lt;1 &amp;&amp; UngarList==null||UngarList.size()&lt;1 )
</code></pre>

<p>It is going into the catch block here</p>

<pre><code>catch (Exception e) {

        this.errorText = e.getMessage().toString();
        info.setErrorText(this.errorText.toString());
        response.setinfo(info);

    }
</code></pre>

<p>But still it is execuing the next lines that is </p>

<pre><code>final boolean toProceedorNot = validate(bagList.toArray(new Bag[bagList.size()]))
</code></pre>

<p>what is want is if this is met </p>

<pre><code>if (bagList==null||bagList.size()&lt;1 &amp;&amp; UngarList==null||UngarList.size()&lt;1 )
**then directly return the   response;**
</code></pre>

<p>This is my method</p>

<pre><code>public Response getData(Request request) {

    Info info = new Info();

    Response response = new Response();
    String xmlrequest = request.getxmlMessage();

    HashMap listMap = new HashMap();
    List&lt;Ungar&gt; UngarList = new ArrayList&lt;Ungar&gt;();
    List&lt;Bag&gt; bagList = new ArrayList&lt;Bag&gt;();

    UniverseStaxParser xmlparser = new UniverseStaxParser();
    try {
        listMap = (HashMap) xmlparser.parseData(xmlrequest);

        UngarList = (List&lt;Ungar&gt;) listMap.get("UngarItems");

        bagList = (List&lt;Bag&gt;) listMap.get("bagItems");


        if (bagList==null||bagList.size()&lt;1 &amp;&amp; UngarList==null||UngarList.size()&lt;1 )
            throw new Exception("No Valid Data is passed as Input ");

    } catch (Exception e) {

        this.errorText = e.getMessage().toString();
        info.setErrorText(this.errorText.toString());
        response.setinfo(info);

    }

    final boolean toProceedorNot = validate(bagList.toArray(new Bag[bagList.size()]));


    try {
        if (!toProceedorNot) {
            info.setErrorText(errorText);
            response.setinfo(info);

        } else {

            // some logic here goes 
        }
    } catch (Exception e) {
        errorText = e.getMessage().toString();
        info.setErrorText(errorText);
        response.setinfo(info);
    }



    return response;
}
</code></pre>
