Exception: PgVerify::Model::Validation::DeadlockInFSMError

Inherits:
Core::Error
  • Object
show all
Defined in:
lib/pg-verify/model/validation/errors.rb

Instance Method Summary collapse

Methods inherited from Core::Error

#to_formatted

Constructor Details

#initialize(program_graph, deadlock_state) ⇒ DeadlockInFSMError

Returns a new instance of DeadlockInFSMError.



118
119
120
# File 'lib/pg-verify/model/validation/errors.rb', line 118

def initialize(program_graph, deadlock_state)
    @program_graph, @deadlock_state = program_graph, deadlock_state
end

Instance Method Details

#formattedObject



121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/pg-verify/model/validation/errors.rb', line 121

def formatted()
    trace = Model::Trace.new(@program_graph, [@deadlock_state])

    title = "Deadlock in program graph #{@program_graph.name}"
    body = "The following state has no successor:\n\n"
    body += trace.to_s(include_steps: false).indented(str: ">>  ".c_error)

    hint = []
    hint << "This indicates a range violation:"
    hint << "Once your graph is in the mentioned state (which is reachable),"
    hint << "all outgoing transitions are blocked due to variable range violations."
    return title, body, hint.join("\n")
end