lib/io_streams/errors.rb in iostreams-1.5.1 vs lib/io_streams/errors.rb in iostreams-1.6.0
- old
+ new
@@ -7,10 +7,13 @@
end
class MissingHeader < Error
end
+ class UnknownFormat < Error
+ end
+
class TypeMismatch < Error
end
class CommunicationsFailure < Error
end
@@ -22,9 +25,18 @@
# Fixed length line has the wrong length
class InvalidLineLength < Error
end
class ValueTooLong < Error
+ end
+
+ class MalformedDataError < RuntimeError
+ attr_reader :line_number
+
+ def initialize(message, line_number)
+ @line_number = line_number
+ super("#{message} on line #{line_number}.")
+ end
end
class InvalidLayout < Error
end
end