lib/runcible/base.rb in runcible-1.3.4 vs lib/runcible/base.rb in runcible-1.3.5
- old
+ new
@@ -1,9 +1,6 @@
-# Copyright (c) 2012 Red Hat
#
-# MIT License
-#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@@ -80,10 +77,13 @@
args << headers
response = get_response(client, path, *args)
process_response(response)
+ rescue RestClient::ResourceNotFound => e
+ log_info
+ raise e
rescue => e
log_exception
raise e
end
@@ -208,9 +208,16 @@
def log_exception
if self.config[:logging][:exception]
log_message = generate_log_message
self.config[:logging][:logger].error(log_message)
+ end
+ end
+
+ def log_info
+ if self.config[:logging][:info]
+ log_message = generate_log_message
+ self.config[:logging][:logger].info(log_message)
end
end
def generate_log_message
RestClient.log.join('\n')