app/controllers/spree/api/base_controller.rb in solidus_api-1.4.2 vs app/controllers/spree/api/base_controller.rb in solidus_api-2.0.0.beta1
- old
+ new
@@ -71,12 +71,11 @@
Rails.logger.error exception.message
Rails.logger.error exception.backtrace.join("\n")
error_notifier.call(exception, self) if error_notifier
- render text: { exception: exception.message }.to_json,
- status: 422
+ render json: { exception: exception.message }, status: 422
end
def gateway_error(exception)
@order.errors.add(:base, exception.message)
invalid_resource!(@order)
@@ -147,10 +146,10 @@
end
def lock_order
OrderMutex.with_lock!(@order) { yield }
rescue Spree::OrderMutex::LockFailed => e
- render text: e.message, status: 409
+ render plain: e.message, status: 409
end
def insufficient_stock_error(exception)
logger.error "insufficient_stock_error #{exception.inspect}"
render(