git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[JGIT PATCH] BlobBasedConfig now does not print stacktrace to stderr if blob is not found by path

From
CPConstantine Plotnikov <constantine.plotnikov@gmail.com>
Date
Jul 1, 2009, 17:25 UTC
Message-ID
<1246469122-5108-1-git-send-email-constantine.plotnikov@gmail.com>

Prior to this patch, if the blob is not found inside commit by path, an exception stack trace was printed to stderr. This patch suppress this behavior by throwing FileNotFoundException instead of generic IOException in order to make it more aligned with FileBasedConfig.

Signed-off-by: Constantine Plotnikov <constantine.plotnikov@gmail.com>
---
 .../src/org/spearce/jgit/lib/BlobBasedConfig.java  |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java
index 1f44994..8763c6c 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/BlobBasedConfig.java
@@ -37,6 +37,7 @@
 package org.spearce.jgit.lib;
 
 import java.io.ByteArrayInputStream;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.concurrent.Callable;
@@ -118,7 +119,7 @@ this(base, new Callable<byte[]>() {
 				final Repository r = commit.getRepository();
 				final TreeWalk tree = TreeWalk.forPath(r, path, treeId);
 				if (tree == null) {
-					throw new IOException("Entry not found by path: " + path);
+					throw new FileNotFoundException("Entry not found by path: " + path);
 				}
 				ObjectId blobId = tree.getObjectId(0);
 				ObjectLoader loader = tree.getRepository().openBlob(blobId);
-- 
1.6.1.2
Message 1 of 1 in “BlobBasedConfig now does not print stacktrace to stderr if blob is not found by path”
  1. BlobBasedConfig now does not print stacktrace to stderr if blob is not found by pathConstantine Plotnikov, Jul 1, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.