From c73bfee474b2be39e81956f291ba7177d99cd735 Mon Sep 17 00:00:00 2001 From: Paul Millar Date: Thu, 4 Aug 2016 10:48:06 +0200 Subject: [PATCH] common: include filename in error message Motivation: If there is an IOException when reading the setup file, the corresponding filename is not included in the message. This may make diagnosing the problem harder for the admin. Modification: Wrap the IOException to include the filename. Result: More useful error messages Target: master Requires-notes: yes Requires-book: no Request: 2.16 Request: 2.15 Request: 2.14 Request: 2.13 Patch: https://rb.dcache.org/r/9587/ Acked-by: Gerd Behrmann Conflicts: modules/dcache/src/main/java/org/dcache/cells/UniversalSpringCell.java --- .../src/main/java/org/dcache/cells/UniversalSpringCell.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/dcache/src/main/java/org/dcache/cells/UniversalSpringCell.java b/modules/dcache/src/main/java/org/dcache/cells/UniversalSpringCell.java index bf018552f19..b1609ff85bf 100644 --- a/modules/dcache/src/main/java/org/dcache/cells/UniversalSpringCell.java +++ b/modules/dcache/src/main/java/org/dcache/cells/UniversalSpringCell.java @@ -449,6 +449,9 @@ private void execFile(File setup) lineCount + ": " + e.getMessage()); } } + } catch (IOException e) { + throw new IOException("Failed to read " + setup + ": " + + e.getMessage(), e); } finally { try { br.close();