Add logging.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 12 Oct 2010 14:53:50 +0000 (16:53 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 12 Oct 2010 14:53:50 +0000 (16:53 +0200)
src/main/java/net/pterodactylus/sone/core/FreenetInterface.java

index 8f9ec8f..5d0a1a2 100644 (file)
@@ -69,12 +69,16 @@ public class FreenetInterface extends AbstractService {
         * @return The result of the fetch, or {@code null} if an error occured
         */
        public FetchResult fetchUri(FreenetURI uri) {
+               logger.entering(FreenetInterface.class.getName(), "fetchUri(FreenetURI)", uri);
+               FetchResult fetchResult = null;
                try {
-                       return client.fetch(uri);
+                       fetchResult = client.fetch(uri);
                } catch (FetchException fe1) {
                        logger.log(Level.WARNING, "Could not fetch “" + uri + "”!", fe1);
-                       return null;
+               } finally {
+                       logger.exiting(FreenetInterface.class.getName(), "fetchUri(FreenetURI)", fetchResult);
                }
+               return fetchResult;
        }
 
 }