From c624c88274055b74256f0992ad733f0873d5618e Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Tue, 24 Apr 2012 12:27:16 -0700 Subject: [PATCH] better exception message on key not found --- core/src/main/java/org/jclouds/ContextBuilder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/java/org/jclouds/ContextBuilder.java b/core/src/main/java/org/jclouds/ContextBuilder.java index eed4b9c408..9d8074955d 100644 --- a/core/src/main/java/org/jclouds/ContextBuilder.java +++ b/core/src/main/java/org/jclouds/ContextBuilder.java @@ -231,6 +231,8 @@ public class ContextBuilder { try { return find(newArrayList(mutable.getProperty(prov + "." + key), mutable.getProperty("jclouds." + key)), notNull()); + } catch (NoSuchElementException e) { + throw new NoSuchElementException(String.format("property %s.%s not present in properties: %s", prov, key, mutable.keySet())); } finally { mutable.remove(prov + "." + key); mutable.remove("jclouds." + key);