Fix ErrorHandler crash when couch is not available

@ticoann, @amaltaro 
this is first attempt at fix for issue #5144

please review