class ZipContainer::MalformedContainerError

This exception is raised when a bad Container is detected.

Public Class Methods

new click to toggle source
new(reason)
new(reason_list)

Create a new MalformedContainerError with an optional reason or list of reasons for why the Container is malformed.

Calls superclass method
# File lib/zip-container/exceptions.rb, line 55
def initialize(reason = nil)
  if reason.nil? || reason.empty?
    super("Malformed Container.")
  elsif reason.is_a?(Array)
    reasons = reason.map { |r| " * #{r}\n" }
    super("Malformed Container:\n#{reasons}")
  else
    super("Malformed Container: #{reason}")
  end
end