Class: Texd::Client::CompilationError

Inherits:
RenderError show all
Defined in:
lib/texd/client.rb

Overview

Raised if the TeX compilation process failed.

Instance Attribute Summary collapse

Attributes inherited from RenderError

#details

Instance Method Summary collapse

Constructor Details

#initialize(message, details: nil, logs: nil) ⇒ CompilationError

Returns a new instance of CompilationError.



38
39
40
41
# File 'lib/texd/client.rb', line 38

def initialize(message, details: nil, logs: nil)
  @logs = logs
  super(message, details: details)
end

Instance Attribute Details

#logsObject (readonly)

TeX compiler logs. Only available if Texd.config.error_format is “full” or “condensed”.



36
37
38
# File 'lib/texd/client.rb', line 36

def logs
  @logs
end

Instance Method Details

#write_to(io) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/texd/client.rb', line 43

def write_to(io)
  io << "Compilation failed: #{message}\n"
  if details
    io.print "Details: "
    PP.pp(details, io)
  end

  if logs
    io << "Logs:\n" << logs
  else
    io << "Logs: not available"
  end
end