lib/avromatic/io/datum_reader.rb in avromatic-0.17.0 vs lib/avromatic/io/datum_reader.rb in avromatic-0.17.1
- old
+ new
@@ -9,11 +9,11 @@
UNION_MEMBER_INDEX = '__avromatic_member_index'.freeze
def read_data(writers_schema, readers_schema, decoder, initial_record = {})
# schema matching
unless self.class.match_schemas(writers_schema, readers_schema)
- raise SchemaMatchException.new(writers_schema, readers_schema)
+ raise Avro::IO::SchemaMatchException.new(writers_schema, readers_schema)
end
# schema resolution: reader's schema is a union, writer's schema is not
if writers_schema.type_sym != :union && readers_schema.type_sym == :union
rs_index = readers_schema.schemas.find_index do |s|
@@ -21,11 +21,11 @@
end
union_info = { UNION_MEMBER_INDEX => rs_index }
return read_data(writers_schema, readers_schema.schemas[rs_index], decoder, union_info) if rs_index
- raise SchemaMatchException.new(writers_schema, readers_schema)
+ raise Avro::IO::SchemaMatchException.new(writers_schema, readers_schema)
end
# function dispatch for reading data based on type of writer's schema
datum = case writers_schema.type_sym
when :null; decoder.read_null
@@ -41,10 +41,10 @@
when :array; read_array(writers_schema, readers_schema, decoder)
when :map; read_map(writers_schema, readers_schema, decoder)
when :union; read_union(writers_schema, readers_schema, decoder)
when :record, :error, :request; read_record(writers_schema, readers_schema, decoder, initial_record)
else
- raise AvroError.new("Cannot read unknown schema type: #{writers_schema.type}")
+ raise Avro::AvroError.new("Cannot read unknown schema type: #{writers_schema.type}")
end
# Allow this code to be used with an official Avro release or the
# avro-salsify-fork that includes logical_type support.
if readers_schema.respond_to?(:logical_type)