Sha256: 30d89f3bb5f8be145d52945850a85c5e0354fb6fcbf8cd33cdb2bde7fefdb5d1

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 KB

Contents

# Copyright (C) 2013-2014  Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

module ChupaText
  class Error < StandardError
  end

  class EncryptedError < Error
    attr_reader :data
    def initialize(data)
      @data = data
      super("Encrypted data: <#{data.path}>(#{data.mime_type})")
    end
  end

  class InvalidDataError < Error
    attr_reader :data, :detail
    def initialize(data, detail)
      @data = data
      @detail = detail
      super("Invalid data: <#{data.path}>(#{data.mime_type}): <#{detail}>")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chupa-text-1.0.4 lib/chupa-text/error.rb
chupa-text-1.0.3 lib/chupa-text/error.rb