{"thread":{"id":"19993","subject":"[JGIT PATCH] BlobBasedConfig now does not print stacktrace to stderr if blob is not found by path","startedAt":"2009-07-01T17:25:22Z","lastAt":"2009-07-01T17:25:22Z","messageCount":1,"participants":["Constantine Plotnikov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"117306","messageId":"1246469122-5108-1-git-send-email-constantine.plotnikov@gmail.com","threadId":"19993","inReplyTo":null,"subject":"[JGIT PATCH] BlobBasedConfig now does not print stacktrace to stderr if blob is not found by path","fromName":"Constantine Plotnikov","fromEmail":"constantine.plotnikov@gmail.com","sentAt":"2009-07-01T17:25:22Z","receivedAt":"2009-07-01T17:25:22Z","isPatch":true,"sender":{"key":"constantine.plotnikov@gmail.com","avatar":null},"body":"Prior to this patch, if the blob is not found inside commit by path,\nan exception stack trace was printed to stderr. This patch suppress\nthis behavior by throwing FileNotFoundException instead of generic\nIOException in order to make it more aligned with FileBasedConfig.\n\nSigned-off-by: Constantine Plotnikov <constantine.plotnikov@gmail.com>\n---\n .../src/org/spearce/jgit/lib/BlobBasedConfig.java  |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java\nindex 1f44994..8763c6c 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java\n@@ -37,6 +37,7 @@\n package org.spearce.jgit.lib;\n \n import java.io.ByteArrayInputStream;\n+import java.io.FileNotFoundException;\n import java.io.IOException;\n import java.io.InputStream;\n import java.util.concurrent.Callable;\n@@ -118,7 +119,7 @@ this(base, new Callable<byte[]>() {\n \t\t\t\tfinal Repository r = commit.getRepository();\n \t\t\t\tfinal TreeWalk tree = TreeWalk.forPath(r, path, treeId);\n \t\t\t\tif (tree == null) {\n-\t\t\t\t\tthrow new IOException(\"Entry not found by path: \" + path);\n+\t\t\t\t\tthrow new FileNotFoundException(\"Entry not found by path: \" + path);\n \t\t\t\t}\n \t\t\t\tObjectId blobId = tree.getObjectId(0);\n \t\t\t\tObjectLoader loader = tree.getRepository().openBlob(blobId);\n-- \n1.6.1.2\n"}]}