padrino/padrino-framework · error

You cannot use :except with other options specified

Error message

You cannot use :except with other options specified

What it means

Error "You cannot use :except with other options specified" thrown in padrino/padrino-framework.

Source

Thrown at padrino-core/lib/padrino-core/application/routing.rb:222

      #   end
      #
      # @example if filters based on a symbol or regexp
      #   before :index, /main/ do; ... end
      #   # => match only path that are  +/+ or contains +main+
      #
      # @example filtering everything except an occurrence
      #   before except: :index do; ...; end
      #
      # @example you can also filter using a request param
      #   before agent: /IE/ do; ...; end
      #   # => match +HTTP_USER_AGENT+ containing +IE+
      #
      # @see http://padrinorb.com/guides/controllers/route-filters/
      #
      def construct_filter(*args, &block)
        options = args.last.is_a?(Hash) ? args.pop : {}
        if (except = options.delete(:except))
          raise 'You cannot use :except with other options specified' unless args.empty? && options.empty?
          except = Array(except)
          options = except.last.is_a?(Hash) ? except.pop : {}
        end
        Filter.new(!except, @_controller, options, Array(except || args), &block)
      end

      ##
      # Provides many parents with shallowing.
      #
      # @param [Symbol] name
      #   The parent name.
      #
      # @param [Hash] options
      #   Additional options.
      #
      # @example
      #   controllers :product do
      #     parent :shop, optional: true, map: "/my/stand"

View on GitHub (pinned to 167044f3d5)

When it happens

Trigger: Thrown at padrino-core/lib/padrino-core/application/routing.rb:222 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of padrino/padrino-framework@167044f3d5 (2026-08-23). Data as JSON: /api/errors/4c579d8def0a111b. Report an issue: GitHub.