Method: Bwrap::Execution::Labels.resolve_exit_code

Defined in:
lib/bwrap/execution/labels.rb

.resolve_exit_code(label) ⇒ Integer

Converts given label to real exit code.

Accepted labels:

  • :success

  • :unspecified

  • :generic

  • :target_host_not_found

  • :no_package_manager

  • :debootstrap_failed

  • :file_not_modified

Additional labels can be added with add_label.

Parameters:

  • label (Symbol)

    Label to be converted to a exit code

Returns:

  • (Integer)

    Exit code between 0 to 255



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/bwrap/execution/labels.rb', line 49

def self.resolve_exit_code label
  return @additional_labels[label] if @additional_labels and @additional_labels[label]

  case label
  when :success
    NO_ERROR
  when :unspecified
    UNSPECIFIED_ERROR
  when :generic
    GENERIC_ERROR
  else
    warn "Got invalid error label: #{label}"
    INVALID_ERROR
  end
end