Merge branch 'develop' into dev_aliyun

pay_subject
daiao 5 years ago
commit 8f64ee3e24

@ -2,10 +2,10 @@ module ControllerRescueHandler
extend ActiveSupport::Concern extend ActiveSupport::Concern
included do included do
rescue_from Exception do |e| # rescue_from Exception do |e|
Util.logger_error e # Util.logger_error e
render json: {status: -1, message: "接口异常"} # render json: {status: -1, message: "接口异常"}
end # end
rescue_from Mysql2::Error do |e| rescue_from Mysql2::Error do |e|
Util.logger_error e Util.logger_error e
render json: {status: -1, message: "接口数据异常"} render json: {status: -1, message: "接口数据异常"}
@ -24,8 +24,9 @@ module ControllerRescueHandler
rescue_from ActiveRecord::RecordInvalid do |ex| rescue_from ActiveRecord::RecordInvalid do |ex|
render_error(ex.record.errors.full_messages.join(',')) render_error(ex.record.errors.full_messages.join(','))
end end
rescue_from RuntimeError do |ex| # rescue_from RuntimeError do |ex|
render_error(ex.message) # Util.logger_error "#######ex:#{ex}"
end # render_error(ex.message)
# end
end end
end end
Loading…
Cancel
Save