Discussion Feed
05-18-2018
08:04 AM
1 Kudo
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.
... View more
Latest Activity
- Got a Kudo for Exception is reported even though its caught within the context of business transaction. 02-24-2020 12:48 AM
- Posted Exception is reported even though its caught within the context of business transaction on Dashboards. 05-18-2018 08:04 AM
- Tagged Exception is reported even though its caught within the context of business transaction on Dashboards. 05-18-2018 08:04 AM
Community Stats
Date Registered | 05-18-2018 07:53 AM |
Date Last Visited | 11-20-2018 09:07 PM |
Total Messages Posted | 2 |
Total Kudos Received | 1 |