File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
lib/fog/proxmox/compute/models Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,16 @@ def get(id)
53
53
status_data = service . get_server_status path_params
54
54
config_data = service . get_server_config path_params
55
55
rescue StandardError => e
56
- if e . respond_to? ( 'response' ) && e . response . respond_to? ( 'data' ) && e . response . data . has_key? ( :reason_phrase ) && e . response . data [ :reason_phrase ] . end_with? ( 'does not exist' )
57
- raise ( Fog ::Errors ::NotFound )
56
+ if e . respond_to? ( 'response' ) && e . response . respond_to? ( 'data' ) && e . response . data . has_key? ( :body )
57
+ begin
58
+ json = JSON . parse ( e . response . body )
59
+ if json [ 'message' ] &.include? ( 'does not exist' )
60
+ raise ( Fog ::Errors ::NotFound )
61
+ end
62
+ rescue StandardError
63
+ raise e
64
+ end
58
65
end
59
-
60
66
raise ( e )
61
67
else
62
68
data = status_data . merge ( config_data ) . merge ( node : node_id , vmid : id )
You can’t perform that action at this time.
0 commit comments