Inherit errors from StandardError instead of Exception.
This commit is contained in:
@@ -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