lib/bioinform/errors.rb in bioinform-0.2.2 vs lib/bioinform/errors.rb in bioinform-0.3.0
- old
+ new
@@ -9,9 +9,16 @@
super(msg)
@validation_errors = options.fetch(:validation_errors, [])
end
def to_s
- "#{super} (#{@validation_errors.join('; ')})"
+ case @validation_errors
+ when Array
+ "#{super} (#{@validation_errors.join('; ')})"
+ when ValidationResult
+ "#{super}\n#{@validation_errors}"
+ else
+ "#{super} (#{@validation_errors})"
+ end
end
end
end