1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00
paper-trail-gem--paper_trail/lib/paper_trail/errors.rb

34 lines
717 B
Ruby
Raw Normal View History

2021-04-05 15:56:51 -04:00
# frozen_string_literal: true
module PaperTrail
# Generic PaperTrail exception.
# @api public
class Error < StandardError
end
# An unexpected option, perhaps a typo, was passed to a public API method.
# @api public
class InvalidOption < Error
end
# The application's database schema is not supported.
# @api public
class UnsupportedSchema < Error
end
# The application's database column type is not supported.
# @api public
class UnsupportedColumnType < UnsupportedSchema
def initialize(method:, expected:, actual:)
super(
format(
"%s expected %s column, got %s",
method,
expected,
actual
)
)
end
end
2021-04-05 15:56:51 -04:00
end