Exception: Transcriptic::LabfileReadError

Inherits:
TranscripticError show all
Defined in:
lib/transcriptic/errors.rb

Instance Method Summary collapse

Methods inherited from TranscripticError

status_code

Constructor Details

#initialize(original_error) ⇒ LabfileReadError

Returns a new instance of LabfileReadError.



13
14
15
# File 'lib/transcriptic/errors.rb', line 13

def initialize(original_error)
  @original_error = original_error
end

Instance Method Details

#status_codeObject



19
20
21
# File 'lib/transcriptic/errors.rb', line 19

def status_code
  @original_error.respond_to?(:status_code) ? @original_error.status_code : 113
end

#to_sObject



23
24
25
26
27
28
29
# File 'lib/transcriptic/errors.rb', line 23

def to_s
  [
    "An error occurred while reading the Labfile:",
    "",
    "  " +  @original_error.to_s.split("\n").map(&:strip).join("\n  "),
  ].join("\n")
end