Inherit errors from StandardError instead of Exception.
This commit is contained in:
@@ -37,6 +37,9 @@ Layout/SpaceInsideBlockBraces:
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Enabled: false
|
||||
|
||||
Lint/InheritException:
|
||||
EnforcedStyle: standard_error
|
||||
|
||||
Naming/MethodParameterName:
|
||||
Enabled: false
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Maintenance
|
||||
module User
|
||||
class EmailNotificationsController < ApplicationController
|
||||
class VerificationError < Exception; end
|
||||
class VerificationError < StandardError; end
|
||||
|
||||
before_action :validate_sig, :only => [:destroy]
|
||||
rescue_from VerificationError, :with => :render_403
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class TagBatchChangeJob < ApplicationJob
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
queue_as :bulk_update
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ require 'resolv'
|
||||
module Downloads
|
||||
class File
|
||||
include ActiveModel::Validations
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
RETRIABLE_ERRORS = [Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EIO, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Timeout::Error, IOError]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module PaginationExtension
|
||||
class PaginationError < Exception; end
|
||||
class PaginationError < StandardError; end
|
||||
|
||||
attr_accessor :current_page, :records_per_page, :paginator_count, :paginator_mode
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class PawooApiClient
|
||||
STATUS1 = %r!\Ahttps?://pawoo\.net/web/statuses/(\d+)!
|
||||
STATUS2 = %r!\Ahttps?://pawoo\.net/@.+?/([^/]+)!
|
||||
|
||||
class MissingConfigurationError < Exception; end
|
||||
class MissingConfigurationError < StandardError; end
|
||||
|
||||
class Account
|
||||
attr_reader :json
|
||||
|
||||
@@ -23,7 +23,7 @@ class PixivApiClient
|
||||
VistaPro Sculptris Comi\ Po! modo DAZ\ Studio 3D-Coat
|
||||
]
|
||||
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
class BadIDError < Error; end
|
||||
|
||||
class WorkResponse
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module PostSets
|
||||
class SearchError < Exception
|
||||
class SearchError < StandardError
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module PostSets
|
||||
class SearchError < Exception
|
||||
class SearchError < StandardError
|
||||
end
|
||||
|
||||
class WikiPage < PostSets::Post
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class SessionLoader
|
||||
class AuthenticationFailure < Exception; end
|
||||
class AuthenticationFailure < StandardError; end
|
||||
|
||||
attr_reader :session, :cookies, :request, :params
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class UploadService
|
||||
class Replacer
|
||||
extend Memoist
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
attr_reader :post, :replacement
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class UserDeletion
|
||||
class ValidationError < Exception; end
|
||||
class ValidationError < StandardError; end
|
||||
|
||||
attr_reader :user, :password
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Artist < ApplicationRecord
|
||||
extend Memoist
|
||||
class RevertError < Exception; end
|
||||
class RevertError < StandardError; end
|
||||
|
||||
attr_accessor :url_string_changed
|
||||
array_attribute :other_names
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class ArtistCommentary < ApplicationRecord
|
||||
class RevertError < Exception; end
|
||||
class RevertError < StandardError; end
|
||||
|
||||
attr_accessor :remove_commentary_tag, :remove_commentary_request_tag, :remove_commentary_check_tag, :remove_partial_commentary_tag
|
||||
attr_accessor :add_commentary_tag, :add_commentary_request_tag, :add_commentary_check_tag, :add_partial_commentary_tag
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class CommentVote < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
belongs_to :comment
|
||||
belongs_to :user
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Favorite < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
belongs_to :post
|
||||
belongs_to :user
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Note < ApplicationRecord
|
||||
class RevertError < Exception; end
|
||||
class RevertError < StandardError; end
|
||||
|
||||
attr_accessor :html_id
|
||||
belongs_to :post
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Pool < ApplicationRecord
|
||||
class RevertError < Exception; end
|
||||
class RevertError < StandardError; end
|
||||
POOL_ORDER_LIMIT = 1000
|
||||
|
||||
array_attribute :post_ids, parse: /\d+/, cast: :to_i
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class PoolVersion < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
belongs_to :pool
|
||||
belongs_to_updater
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
require 'danbooru/has_bit_flags'
|
||||
|
||||
class Post < ApplicationRecord
|
||||
class ApprovalError < Exception; end
|
||||
class DisapprovalError < Exception; end
|
||||
class RevertError < Exception; end
|
||||
class SearchError < Exception; end
|
||||
class DeletionError < Exception; end
|
||||
class TimeoutError < Exception; end
|
||||
class ApprovalError < StandardError; end
|
||||
class DisapprovalError < StandardError; end
|
||||
class RevertError < StandardError; end
|
||||
class SearchError < StandardError; end
|
||||
class DeletionError < StandardError; end
|
||||
class TimeoutError < StandardError; end
|
||||
|
||||
# Tags to copy when copying notes.
|
||||
NOTE_COPY_TAGS = %w[translated partially_translated check_translation translation_request reverse_translation]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class PostAppeal < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
MAX_APPEALS_PER_DAY = 1
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class PostArchive < ApplicationRecord
|
||||
class RevertError < Exception; end
|
||||
class RevertError < StandardError; end
|
||||
extend Memoist
|
||||
|
||||
belongs_to :post
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class PostFlag < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
module Reasons
|
||||
UNAPPROVED = "Unapproved in three days"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class PostVote < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
belongs_to :post
|
||||
belongs_to :user
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
require "tmpdir"
|
||||
|
||||
class Upload < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class Error < StandardError; end
|
||||
|
||||
class FileValidator < ActiveModel::Validator
|
||||
def validate(record)
|
||||
|
||||
@@ -2,8 +2,8 @@ require 'digest/sha1'
|
||||
require 'danbooru/has_bit_flags'
|
||||
|
||||
class User < ApplicationRecord
|
||||
class Error < Exception; end
|
||||
class PrivilegeError < Exception; end
|
||||
class Error < StandardError; end
|
||||
class PrivilegeError < StandardError; end
|
||||
|
||||
module Levels
|
||||
ANONYMOUS = 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class WikiPage < ApplicationRecord
|
||||
class RevertError < Exception; end
|
||||
class RevertError < StandardError; end
|
||||
|
||||
META_WIKIS = ["list_of_", "tag_group:", "pool_group:", "howto:", "about:", "help:", "template:"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user