FEATURE: Support backup uploads/downloads directly to/from S3.

This commit is contained in:
Gerhard Schlager
2018-09-10 16:48:34 +02:00
committed by Guo Xiang Tan
parent 5039a6c3f1
commit c29a4dddc1
52 changed files with 1079 additions and 420 deletions

View File

@ -24,6 +24,12 @@ module JsonError
# If we're passed an array, it's an array of error messages
return { errors: obj.map(&:to_s) } if obj.is_a?(Array) && obj.present?
if obj.is_a?(Exception)
message = obj.cause.message.presence || obj.cause.class.name if obj.cause
message = obj.message.presence || obj.class.name if message.blank?
return { errors: [message] } if message.present?
end
# Log a warning (unless obj is nil)
Rails.logger.warn("create_errors_json called with unrecognized type: #{obj.inspect}") if obj