From 17043d20b7ecacc5e74b800b40d78e42a677c639 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Mon, 11 Feb 2013 11:47:24 +0700 Subject: [PATCH] Catch UnknownHostException --- src/taoensso/timbre.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/taoensso/timbre.clj b/src/taoensso/timbre.clj index 0d708ef..f586517 100644 --- a/src/taoensso/timbre.clj +++ b/src/taoensso/timbre.clj @@ -186,7 +186,9 @@ (def get-hostname (utils/memoize-ttl - 60000 (fn [] (.. java.net.InetAddress getLocalHost getHostName)))) + 60000 (fn [] (try (.. java.net.InetAddress getLocalHost getHostName) + (catch java.net.UnknownHostException e + "UnknownHost"))))) (defn- wrap-appender-juxt "Wraps compile-time appender juxt with additional runtime capabilities