Sha256: 5cb08295acb837ccd65ed7d8f21da2bb69789b32a9ed43c2fd49acb01a2a83a3

Contents?: true

Size: 1.46 KB

Versions: 23

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true
module Thredded
  class Error < StandardError
  end

  module Errors
    class DatabaseEmpty < Thredded::Error
      def message
        'Seed the database with "rake db:seed".'
      end
    end

    class LoginRequired < Thredded::Error
      def message
        I18n.t('thredded.errors.login_required')
      end
    end

    class UserNotFound < Thredded::Error
      def message
        'This user could not be found. Is their name misspelled?'
      end
    end

    class PrivateTopicNotFound < Thredded::Error
      def message
        I18n.t('thredded.errors.private_topic_not_found')
      end
    end

    class TopicNotFound < Thredded::Error
      def message
        'This topic does not exist.'
      end
    end

    class MessageboardNotFound < Thredded::Error
      def message
        'This messageboard does not exist.'
      end
    end

    class MessageboardReadDenied < Thredded::Error
      def message
        'You are not authorized access to this messageboard.'
      end
    end

    class MessageboardCreateDenied < Thredded::Error
      def message
        'You are not authorized to create a new messageboard.'
      end
    end

    class TopicCreateDenied < Thredded::Error
      def message
        'You are not authorized to post in this messageboard.'
      end
    end

    class PrivateTopicCreateDenied < Thredded::Error
      def message
        I18n.t('thredded.errors.private_topic_create_denied')
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
thredded-0.12.1 lib/thredded/errors.rb
thredded-0.12.0 lib/thredded/errors.rb
thredded-0.11.1 lib/thredded/errors.rb
thredded-0.11.0 lib/thredded/errors.rb
thredded-0.10.1 lib/thredded/errors.rb
thredded-0.10.0 lib/thredded/errors.rb
thredded-0.9.4 lib/thredded/errors.rb
thredded-0.9.3 lib/thredded/errors.rb
thredded-0.9.2 lib/thredded/errors.rb
thredded-0.9.1 lib/thredded/errors.rb
thredded-0.8.4 lib/thredded/errors.rb
thredded-0.8.2 lib/thredded/errors.rb
thredded-0.7.0 lib/thredded/errors.rb
thredded-0.6.3 lib/thredded/errors.rb
thredded-0.6.2 lib/thredded/errors.rb
thredded-0.6.1 lib/thredded/errors.rb
thredded-0.6.0 lib/thredded/errors.rb
thredded-0.5.1 lib/thredded/errors.rb
thredded-0.5.0 lib/thredded/errors.rb
thredded-0.4.0 lib/thredded/errors.rb