Dashboards

cancel
Showing results for 
Search instead for 
Did you mean: 

Exception is reported even though its caught within the context of business transaction

New Poster

Exception is reported even though its caught within the context of business transaction

Have a simple method for connection,

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;

public class Connection {

    public boolean connect(URL url, String requestType) {
        HttpURLConnection connection = null;
        try {
            URLConnection urlConnection = url.openConnection();
            if (urlConnection instanceof HttpURLConnection) {
                connection = (HttpURLConnection) urlConnection;
                connection.setRequestMethod(requestType);
                connection.setRequestProperty("Authorization", getAuth()); //$NON-NLS-1$
            }

            if (connection == null) {
                return false;
            }
            connection.connect();
	    connection.getInputStream();

            return connection.getResponseCode() == HttpURLConnection.HTTP_OK;
        } catch (IOException e) {
            return false;
        }
    }
}

 

As the line connection.getInputStream(); is encountered there is a FileNotFoundException thrown for invalida URL, caught as IOException and false is returned, however AppDynamics reports it as a business transaction error.

 

Read this on the Appdynamics documentation “An exception that is thrown and caught within the context of the business transaction is not considered a transaction error and the exception is not captured in AppDynamics. “

 

Can someone explain on why is 'FileNotFoundException' being reported in AppDynamics as business transaction error even though its being caught. Thanks in advance.

Exception is reported even though its caught within the context of business transaction