[Groonga-commit] ranguba/chupa-text at 53af4a3 [master] Add errors

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Feb 17 22:14:19 JST 2014


Kouhei Sutou	2014-02-17 22:14:19 +0900 (Mon, 17 Feb 2014)

  New Revision: 53af4a304624939e69fa1e9a8ad40beafd269762
  https://github.com/ranguba/chupa-text/commit/53af4a304624939e69fa1e9a8ad40beafd269762

  Message:
    Add errors
    
    * EncryptedError
    * InvalidDataError

  Modified files:
    lib/chupa-text/error.rb

  Modified: lib/chupa-text/error.rb (+18 -1)
===================================================================
--- lib/chupa-text/error.rb    2014-02-16 23:49:50 +0900 (34e02d8)
+++ lib/chupa-text/error.rb    2014-02-17 22:14:19 +0900 (3e07885)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013  Kouhei Sutou <kou �� clear-code.com>
+# 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
@@ -17,4 +17,21 @@
 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
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index