Exception: Alda::NREPLServerError
- Inherits:
-
StandardError
- Object
- StandardError
- Alda::NREPLServerError
- Defined in:
- lib/alda-rb/error.rb
Overview
The error is raised when the Alda nREPL server returns problems. This is only available for Alda 2. See Alda::REPL#message.
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
The hostname of the nREPL server.
-
#port ⇒ Object
readonly
The port of the nREPL server.
-
#problems ⇒ Object
readonly
The problems returned by the nREPL server.
-
#status ⇒ Object
readonly
The status returned by the nREPL server.
Instance Method Summary collapse
-
#initialize(host, port, problems, status) ⇒ NREPLServerError
constructor
:call-seq: new(host, port, problems, status) -> Alda::NREPLServerError.
Constructor Details
#initialize(host, port, problems, status) ⇒ NREPLServerError
:call-seq:
new(host, port, problems, status) -> Alda::NREPLServerError
Creates a Alda::NREPLServerError object. Raises Alda::GenerationError if the current generation is not Alda 2.
73 74 75 76 77 78 79 80 81 82 83 84 |
# 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 |
Instance Attribute Details
#host ⇒ Object (readonly)
The hostname of the nREPL server.
50 51 52 |
# File 'lib/alda-rb/error.rb', line 50 def host @host end |
#port ⇒ Object (readonly)
The port of the nREPL server.
54 55 56 |
# File 'lib/alda-rb/error.rb', line 54 def port @port end |
#problems ⇒ Object (readonly)
The problems returned by the nREPL server. This is an Array of String.
59 60 61 |
# File 'lib/alda-rb/error.rb', line 59 def problems @problems end |
#status ⇒ Object (readonly)
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
.
65 66 67 |
# File 'lib/alda-rb/error.rb', line 65 def status @status end |