|
|
|
@ -2,10 +2,10 @@ module ControllerRescueHandler
|
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
|
|
included do
|
|
|
|
|
# rescue_from Exception do |e|
|
|
|
|
|
# Util.logger_error e
|
|
|
|
|
# render json: {status: -1, message: "接口异常"}
|
|
|
|
|
# end
|
|
|
|
|
rescue_from Exception do |e|
|
|
|
|
|
Util.logger_error e
|
|
|
|
|
render json: {status: -1, message: e.message}
|
|
|
|
|
end
|
|
|
|
|
rescue_from Mysql2::Error do |e|
|
|
|
|
|
Util.logger_error e
|
|
|
|
|
render json: {status: -1, message: "接口数据异常"}
|
|
|
|
|