immutable_drop/errors: consolidate errors & fix syntax for raising
Addresses @envygeeks's comments:
bff1726a5a
This commit is contained in:
parent
1afbe9967d
commit
b70ea3ca5c
|
@ -33,8 +33,6 @@ require 'colorator'
|
|||
SafeYAML::OPTIONS[:suppress_warnings] = true
|
||||
|
||||
module Jekyll
|
||||
StandardError = Class.new(::StandardError)
|
||||
|
||||
# internal requires
|
||||
autoload :Cleaner, 'jekyll/cleaner'
|
||||
autoload :Collection, 'jekyll/collection'
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
module Jekyll
|
||||
module Drops
|
||||
class ImmutableDrop < Liquid::Drop
|
||||
IllegalDropModification = Class.new(Jekyll::StandardError)
|
||||
|
||||
def initialize(obj)
|
||||
@obj = obj
|
||||
end
|
||||
|
@ -19,7 +17,7 @@ module Jekyll
|
|||
|
||||
def []=(key, val)
|
||||
if respond_to? key
|
||||
raise IllegalDropModification.new("Key #{key} cannot be set in the drop.")
|
||||
raise DropMutationException, "Key #{key} cannot be set in the drop."
|
||||
else
|
||||
fallback_data[key] = val
|
||||
end
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
module Jekyll
|
||||
module Errors
|
||||
class FatalException < RuntimeError
|
||||
end
|
||||
FatalException = Class.new(::RuntimeError)
|
||||
|
||||
class MissingDependencyException < FatalException
|
||||
end
|
||||
MissingDependencyException = Class.new(FatalException)
|
||||
DropMutationException = Class.new(FatalException)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue