diff --git a/System/Remote/Monitoring/ElasticSearch.hs b/System/Remote/Monitoring/ElasticSearch.hs
--- a/System/Remote/Monitoring/ElasticSearch.hs
+++ b/System/Remote/Monitoring/ElasticSearch.hs
@@ -26,6 +26,7 @@
     ) where
 
 import           Control.Concurrent    (ThreadId, forkIO, threadDelay)
+import           Control.Exception     (catch)
 import           Control.Lens
 import           Control.Monad         (forever, void)
 import qualified Data.HashMap.Strict   as M
@@ -38,6 +39,7 @@
 import           Data.Time.Clock.POSIX (getPOSIXTime)
 import           Data.Time.Format      (defaultTimeLocale, formatTime)
 import           Network.HostName      (getHostName)
+import           Network.HTTP.Client   (HttpException)
 import           Network.Wreq          as Wreq
 import qualified System.Metrics        as Metrics
 
@@ -66,6 +68,9 @@
       -- | Server port
     , _port          :: !Int
 
+      -- | Error handler
+    , _onError       :: !(HttpException -> IO ())
+
       -- | The elasticsearch index to insert into
     , _indexBase     :: !Text
 
@@ -101,6 +106,8 @@
 --
 -- * @port@ = @8125@
 --
+-- * @onException@ = @print@
+--
 -- * @indexBase@ = @metricbeats@
 --
 -- * @indexByDate@ = @True@
@@ -114,6 +121,7 @@
 defaultESOptions = ESOptions
     { _host          = "127.0.0.1"
     , _port          = 9200
+    , _onError       = print
     , _indexBase     = "metricbeat"
     , _indexByDate   = True
     , _beatName      = "ekg"
@@ -185,4 +193,5 @@
 flushSample store eo = do
   createBulk <- mkIndex eo
   bulkEvts <- sampleBeatEvents store eo
-  void $ Wreq.post (elasticURL eo) $ BulkRequest $ (createBulk,) <$> bulkEvts
+  (void $ Wreq.post (elasticURL eo) $ BulkRequest $ (createBulk, ) <$> bulkEvts) `catch`
+    (_onError eo)
diff --git a/ekg-elasticsearch.cabal b/ekg-elasticsearch.cabal
--- a/ekg-elasticsearch.cabal
+++ b/ekg-elasticsearch.cabal
@@ -1,5 +1,5 @@
 name:                ekg-elasticsearch
-version:             0.3.0.0
+version:             0.3.1.0
 synopsis:            Push metrics to elasticsearch
 description:
   This library lets you push system metrics to a elasticsearch server.
@@ -37,4 +37,4 @@
 
 source-repository head
   type:     git
-  location: https://github.com/cdodev/ekg-elastic.git
+  location: https://github.com/cdodev/ekg-elasticsearch.git
