mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
use standard error so its easier to catch
This commit is contained in:
parent
23513eaf87
commit
bb20f64cb2
5 changed files with 6 additions and 6 deletions
|
@ -62,7 +62,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# Some exceptions
|
# Some exceptions
|
||||||
class RenderEmpty < Exception; end
|
class RenderEmpty < StandardError; end
|
||||||
|
|
||||||
# Render nothing
|
# Render nothing
|
||||||
rescue_from RenderEmpty do
|
rescue_from RenderEmpty do
|
||||||
|
@ -121,7 +121,7 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class PluginDisabled < Exception; end
|
class PluginDisabled < StandardError; end
|
||||||
|
|
||||||
# If a controller requires a plugin, it will raise an exception if that plugin is
|
# If a controller requires a plugin, it will raise an exception if that plugin is
|
||||||
# disabled. This allows plugins to be disabled programatically.
|
# disabled. This allows plugins to be disabled programatically.
|
||||||
|
|
|
@ -186,7 +186,7 @@ module Jobs
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
class HandledExceptionWrapper < Exception
|
class HandledExceptionWrapper < StandardError
|
||||||
attr_accessor :wrapped
|
attr_accessor :wrapped
|
||||||
def initialize(ex)
|
def initialize(ex)
|
||||||
super("Wrapped #{ex.class}: #{ex.message}")
|
super("Wrapped #{ex.class}: #{ex.message}")
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'excon'
|
||||||
module Jobs
|
module Jobs
|
||||||
class CrawlTopicLink < Jobs::Base
|
class CrawlTopicLink < Jobs::Base
|
||||||
|
|
||||||
class ReadEnough < Exception; end
|
class ReadEnough < StandardError; end
|
||||||
|
|
||||||
# Retrieve a header regardless of case sensitivity
|
# Retrieve a header regardless of case sensitivity
|
||||||
def self.header_for(head, name)
|
def self.header_for(head, name)
|
||||||
|
|
|
@ -24,7 +24,7 @@ module Autospec
|
||||||
|
|
||||||
require "socket"
|
require "socket"
|
||||||
|
|
||||||
class PhantomJsNotInstalled < Exception; end
|
class PhantomJsNotInstalled < StandardError; end
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
ensure_phantomjs_is_installed
|
ensure_phantomjs_is_installed
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
class RateLimiter
|
class RateLimiter
|
||||||
|
|
||||||
# A rate limit has been exceeded.
|
# A rate limit has been exceeded.
|
||||||
class LimitExceeded < Exception
|
class LimitExceeded < StandardError
|
||||||
attr_accessor :available_in
|
attr_accessor :available_in
|
||||||
def initialize(available_in)
|
def initialize(available_in)
|
||||||
@available_in = available_in
|
@available_in = available_in
|
||||||
|
|
Loading…
Reference in a new issue