{"record":{"id":"f2730d88dd46e1a0","repo":"padrino/padrino-framework","slug":"app-is-required","errorCode":null,"errorMessage":"app is required","messagePattern":"app is required","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"padrino-core/lib/padrino-core/router.rb","lineNumber":58,"sourceCode":"    # @option options [Sinatra::Application] :to\n    #  The class of the application to mount.\n    # @option options [String] :path (\"/\")\n    #  The path to map the specified application.\n    # @option options [String] :host\n    #  The host to map the specified application.\n    #\n    # @example\n    #  map(path: '/', to: PadrinoWeb, host: 'padrino.local')\n    #\n    # @return [Array] The sorted route mappings.\n    # @api semipublic\n    def map(options = {})\n      path = options[:path] || '/'\n      host = options[:host]\n      app  = options[:to]\n\n      raise ArgumentError, 'paths need to start with /' if path[0] != '/'\n      raise ArgumentError, 'app is required' if app.nil?\n\n      path  = path.chomp('/')\n      match = Regexp.new(\"^#{Regexp.quote(path).gsub('/', '/+')}(.*)\", Regexp::NOENCODING)\n      host  = Regexp.new(\"^#{Regexp.quote(host)}$\", Regexp::NOENCODING) unless host.nil? || host.is_a?(Regexp)\n\n      @mapping << [host, path, match, app]\n    end\n\n    # The call handler setup to route a request given the mappings specified.\n    def call(env)\n      began_at = Time.now\n      path_info = env['PATH_INFO'].to_s\n      script_name = env['SCRIPT_NAME']\n      http_host = env['HTTP_HOST']\n      last_result = nil\n\n      @mapping.each do |host, path, match, app|\n        next unless host.nil? || http_host =~ host","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-core/lib/padrino-core/router.rb#L40-L76","documentation":"Error \"app is required\" thrown in padrino/padrino-framework.","triggerScenarios":"Thrown at padrino-core/lib/padrino-core/router.rb:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}