Sha256: 8ed46790dde1e5f39e53fdb29cc6649afb1fee4273920d3bd0a6d878afdea161
Contents?: true
Size: 697 Bytes
Versions: 13
Compression:
Stored size: 697 Bytes
Contents
require 'fiona7/controllers/rest_api/error_handler' module Fiona7 class ApiController < ActionController::Base def perform path = params[:path].to_s verb = params[:verb].to_s.downcase.to_sym payload = params[:params] render json: Scrivito::CmsRestApi.task_unaware_request(verb, path, payload) rescue *Fiona7::ErrorHandler::HANDLED_ERRORS => e message = Fiona7::ErrorHandler.new(e).api_error render json: {error: message}, status: 422 rescue Scrivito::ApplicationError => e render json: {error: e.message}, status: e.http_code rescue Scrivito::ClientError => e render json: {error: e.message}, status: 422 end end end
Version data entries
13 entries across 13 versions & 1 rubygems