Exception: Knife::Proxmox::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/knife-proxmox-ve/errors.rb

Overview

A non-2xx HTTP response from the Proxmox API.

body is pre-scrubbed of secret-bearing keys (token secret, cipassword, sshkeys, password) by the client before the error is constructed, so it is safe to display.

Direct Known Subclasses

AuthError, NotFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status:, body: nil) ⇒ ApiError

Returns a new instance of ApiError.



19
20
21
22
23
# File 'lib/knife-proxmox-ve/errors.rb', line 19

def initialize(message, status:, body: nil)
  @status = status
  @body = body
  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



17
18
19
# File 'lib/knife-proxmox-ve/errors.rb', line 17

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



17
18
19
# File 'lib/knife-proxmox-ve/errors.rb', line 17

def status
  @status
end