class Alda::NREPLServerError

The error is raised when the Alda nREPL server returns problems. This is only available for Alda 2. See Alda::REPL#message.

Attributes

host[R]

The hostname of the nREPL server.

port[R]

The port of the nREPL server.

problems[R]

The problems returned by the nREPL server. This is an Array of String.

status[R]

The status returned by the nREPL server. It is an Array of Symbol. Symbols must appear are :done, :error, and there may be :unknown_op.

Public Class Methods

new(host, port, problems, status) → Alda::NREPLServerError click to toggle source

Creates a Alda::NREPLServerError object. Raises Alda::GenerationError if the current generation is not Alda 2.

Calls superclass method
# File lib/alda-rb/error.rb, line 73
def initialize host, port, problems, status
  Alda::GenerationError.assert_generation [:v2]
  @status = status.map { Alda::Utils.slug_to_snake _1 }
  if @status.include? :unknown_op
    super 'unknown operation'
  else
    super problems.join ?\n
  end
  @host = host
  @port = port
  @problems = problems
end