Sha256: 42071cc1b7053b4eaf48567b1db3cd45c618ceea8d07ce28261c1c0e31c9067d

Contents?: true

Size: 1.83 KB

Versions: 13

Compression:

Stored size: 1.83 KB

Contents

# Custom error classes.
#
module Alchemy

  class CellDefinitionError < StandardError
    # Raised if no cell definition can be found.
  end

  class ContentDefinitionError < StandardError
    # Raised if no content definition can be found.
  end

  class DefaultLanguageNotFoundError < StandardError
    # Raised if no default language can be found.
    def message
      "No default language found. Have you run the rake alchemy:db:seed task?"
    end
  end

  class ElementDefinitionError < StandardError
    # Raised if element definition can not be found.
  end

  class EssenceMissingError < StandardError
    # Raised if a content misses its essence.
    def message
      "Essence not found"
    end
  end

  class MissingImageFileError < StandardError
    # Raised if calling +image_file+ on a Picture object returns nil.
  end

  class PageLayoutDefinitionError < StandardError
    # Raised if page_layout definition can not be found.
  end

  class PictureInUseError < StandardError
    # Raised if the picture is still in use and can not be deleted.
  end

  class TinymceError < StandardError; end

  class UpdateServiceUnavailable < StandardError
    # Raised it no succesful connection to GitHub was possible
    def message
      "The update service is temporarily unavailable!"
    end
  end

  class MissingActiveRecordAssociation < StandardError
    # Raised if a alchemy_resource_relation is defined without proper ActiveRecord association
    def message
      "You need to define proper ActiveRecord associations, if you want to use alchemy_resource_relations."
    end
  end

  class NoCurrentUserFoundError < StandardError
    # Raised if no current_user is found to authorize against.
    def message
      "You need to provide a current_user method in your ApplicationController that returns the current authenticated user."
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 lib/alchemy/errors.rb
alchemy_cms-3.1.0.beta5 lib/alchemy/errors.rb
alchemy_cms-3.1.0.beta4 lib/alchemy/errors.rb
alchemy_cms-3.0.3 lib/alchemy/errors.rb
alchemy_cms-3.1.0.beta3 lib/alchemy/errors.rb
alchemy_cms-3.1.0.beta2 lib/alchemy/errors.rb
alchemy_cms-3.1.0.beta1 lib/alchemy/errors.rb
alchemy_cms-3.0.2 lib/alchemy/errors.rb
alchemy_cms-3.0.1 lib/alchemy/errors.rb
alchemy_cms-3.0.0 lib/alchemy/errors.rb
alchemy_cms-3.0.0.rc8 lib/alchemy/errors.rb
alchemy_cms-3.0.0.rc7 lib/alchemy/errors.rb
alchemy_cms-3.0.0.rc6 lib/alchemy/errors.rb