schemata-router 0.0.1.beta1 → 0.0.1.beta2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,18 @@
|
|
1
1
|
module Schemata
|
2
2
|
class DecodeError < StandardError; end
|
3
3
|
class EncodeError < StandardError; end
|
4
|
-
class
|
4
|
+
class SchemaDefinitionError < StandardError; end
|
5
|
+
|
6
|
+
class UpdateAttributeError < StandardError
|
7
|
+
def initialize(key, message)
|
8
|
+
super("#{key}: #{message}")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
5
12
|
class IncompatibleVersionError < DecodeError
|
6
13
|
def initialize(msg_version, component_version)
|
7
14
|
super("min message version #{msg_version} too high for component ver\
|
8
15
|
sion #{component_version}")
|
9
16
|
end
|
10
17
|
end
|
11
|
-
class SchemaDefinitionError < StandardError; end
|
12
18
|
end
|
@@ -30,7 +30,7 @@ module Schemata
|
|
30
30
|
begin
|
31
31
|
field_schema.validate(field_value)
|
32
32
|
rescue ::Membrane::SchemaValidationError => e
|
33
|
-
raise Schemata::UpdateAttributeError.new(e.message)
|
33
|
+
raise Schemata::UpdateAttributeError.new(key, e.message)
|
34
34
|
end
|
35
35
|
|
36
36
|
@contents[key] = Schemata::HashCopyHelpers.deep_copy(field_value)
|
@@ -55,7 +55,7 @@ module Schemata
|
|
55
55
|
begin
|
56
56
|
field_schema.validate(field_value)
|
57
57
|
rescue ::Membrane::SchemaValidationError => e
|
58
|
-
raise Schemata::UpdateAttributeError.new(e.message)
|
58
|
+
raise Schemata::UpdateAttributeError.new(key, e.message)
|
59
59
|
end
|
60
60
|
@contents[key] = Schemata::HashCopyHelpers.deep_copy(field_value)
|
61
61
|
field_value
|