Exception: Uniword::CorruptedFileError

Inherits:
Error
  • Object
show all
Defined in:
lib/uniword/errors.rb

Overview

Raised when a file is corrupted or malformed

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, reason) ⇒ CorruptedFileError

Returns a new instance of CorruptedFileError.

Parameters:

  • path (String)

    The file path

  • reason (String)

    The reason for corruption



40
41
42
43
44
# File 'lib/uniword/errors.rb', line 40

def initialize(path, reason)
  super("Corrupted file #{path}: #{reason}")
  @path = path
  @reason = reason
end

Instance Attribute Details

#pathString (readonly)

Returns The file path.

Returns:

  • (String)

    The file path



47
48
49
# File 'lib/uniword/errors.rb', line 47

def path
  @path
end

#reasonString (readonly)

Returns The reason.

Returns:

  • (String)

    The reason



50
51
52
# File 'lib/uniword/errors.rb', line 50

def reason
  @reason
end