rosetta-stone 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c000b67224ecdf1b44c25b80edf33095de22f75e83458ae19f28f87f34cfe91
4
- data.tar.gz: 4903ac60987dbdc6540363f3eb0cac96ace899a7590f6fd80ae0ee94889a139d
3
+ metadata.gz: 74b44eea5d34490ee6f3a8a223c4d43f7ff49cdbad64583e185a75a18f90b750
4
+ data.tar.gz: 5d2a05143f28cd7af0abdd40fe80080f605957d6a52786dfffda40ef8cc15576
5
5
  SHA512:
6
- metadata.gz: fd3cfd1efd01650d80c27b150f08cdb428a628da3673f4b3385888030471ee733298d308c554a35e6b5ae9cfa7ee2aa2f27602f844a45723993674a00a311b70
7
- data.tar.gz: 6c523eeb7466cc2db487e25fbc53ce65b9c38a59747eeaefce28d47e51a1be23363a509a2ca29d200d6ac72c5ded13e1a8d3d86b20be6f95f662edded65322be
6
+ metadata.gz: 95566db28c9e7d121dcb4a782475b9de9497462f3eabf5763caa6095a6178a1c6f5acd61c9fab8406e3d538f2d8b8816939958147b1b2f146451ed5050ac6770
7
+ data.tar.gz: e451ece8911cb05d744a2842df92254b14240aa2b7dca4fd4ecf2c04a84ea126ce07df30b14168bc97d861aa634d178f4afa6af4ff5d36ab87ebfdee5171c993
@@ -17,6 +17,8 @@ module Rosetta
17
17
 
18
18
  def call(input)
19
19
  new(input).call
20
+ rescue StandardError
21
+ raise DeserializtionError
20
22
  end
21
23
  alias_method :deserialize, :call
22
24
 
@@ -1,5 +1,6 @@
1
1
  module Rosetta
2
2
  class ConversionError < StandardError; end
3
+ class TranslationError < ConversionError; end
3
4
  class SerializationError < ConversionError; end
4
5
  class DeserializationError < ConversionError; end
5
6
 
@@ -18,6 +18,8 @@ module Rosetta
18
18
 
19
19
  def call(elements)
20
20
  new(elements).call
21
+ rescue StandardError
22
+ raise SerializationError
21
23
  end
22
24
  alias_method :serialize, :call
23
25
 
@@ -32,6 +32,10 @@ module Rosetta
32
32
  elements = deserializer.call(input)
33
33
  serializer.call(elements)
34
34
  end
35
+ rescue ConversionError => e
36
+ raise e # No double-wrapping conversion errors
37
+ rescue StandardError
38
+ raise TranslationError
35
39
  end
36
40
 
37
41
  def to_proc
@@ -1,3 +1,3 @@
1
1
  module Rosetta
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rosetta-stone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jérémie Bonal