2017-07-24 16:20:53 -04:00
# frozen_string_literal: true
2009-06-16 14:32:38 -04:00
module ActionController
class ActionControllerError < StandardError #:nodoc:
end
2012-05-20 05:04:12 -04:00
class BadRequest < ActionControllerError #:nodoc:
2016-05-10 03:13:49 -04:00
def initialize ( msg = nil )
2015-10-19 10:18:09 -04:00
super ( msg )
2015-11-03 09:54:34 -05:00
set_backtrace $! . backtrace if $!
end
2012-05-20 05:04:12 -04:00
end
2009-06-16 14:32:38 -04:00
class RenderError < ActionControllerError #:nodoc:
end
class RoutingError < ActionControllerError #:nodoc:
attr_reader :failures
2016-10-28 23:05:58 -04:00
def initialize ( message , failures = [ ] )
2009-06-16 14:32:38 -04:00
super ( message )
@failures = failures
end
end
2018-04-04 14:20:15 -04:00
class UrlGenerationError < ActionControllerError #:nodoc:
2012-08-01 16:33:15 -04:00
end
2009-06-16 14:32:38 -04:00
class MethodNotAllowed < ActionControllerError #:nodoc:
def initialize ( * allowed_methods )
2016-08-06 13:35:13 -04:00
super ( " Only #{ allowed_methods . to_sentence ( locale : :en ) } requests are allowed. " )
2009-06-16 14:32:38 -04:00
end
end
2009-12-11 01:01:22 -05:00
2009-06-16 14:32:38 -04:00
class NotImplemented < MethodNotAllowed #:nodoc:
end
class MissingFile < ActionControllerError #:nodoc:
end
class SessionOverflowError < ActionControllerError #:nodoc:
2016-08-06 12:51:43 -04:00
DEFAULT_MESSAGE = " Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data. "
2009-06-16 14:32:38 -04:00
def initialize ( message = nil )
super ( message || DEFAULT_MESSAGE )
end
end
class UnknownHttpMethod < ActionControllerError #:nodoc:
end
2012-05-20 05:04:12 -04:00
2011-07-27 18:37:06 -04:00
class UnknownFormat < ActionControllerError #:nodoc:
end
2017-05-30 10:12:34 -04:00
2018-07-26 12:29:57 -04:00
# Raised when a nested respond_to is triggered and the content types of each
2019-01-26 06:45:50 -05:00
# are incompatible. For example:
2018-07-26 12:29:57 -04:00
#
# respond_to do |outer_type|
# outer_type.js do
# respond_to do |inner_type|
# inner_type.html { render body: "HTML" }
# end
# end
# end
class RespondToMismatchError < ActionControllerError
DEFAULT_MESSAGE = " respond_to was called multiple times and matched with conflicting formats in this action. Please note that you may only call respond_to and match on a single format per action. "
def initialize ( message = nil )
super ( message || DEFAULT_MESSAGE )
end
end
2017-05-30 10:12:34 -04:00
class MissingExactTemplate < UnknownFormat #:nodoc:
end
2012-01-14 15:25:11 -05:00
end