diff options
Diffstat (limited to 'files')
-rw-r--r-- | files/couch-doc-update | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/files/couch-doc-update b/files/couch-doc-update index 625847f..9101802 100644 --- a/files/couch-doc-update +++ b/files/couch-doc-update @@ -38,11 +38,17 @@ def main exit 0 if result['ok'] raise StandardError.new(result.inspect) rescue StandardError => exc - $stderr.puts "ERROR: " + exc.to_s + db_without_password = db.to_s.sub(/:[^\/]*@/, ':PASSWORD_HIDDEN@') + log "ERROR: " + exc.to_s + log " failed writing to #{db_without_password}/#{id}" + exit 1 +end + +def log(message) + $stderr.puts message Syslog.open do |logger| - logger.log(Syslog::LOG_CRIT, exc.to_s) + logger.log(Syslog::LOG_CRIT, message) end - exit 1 end def process_options |