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)
5353 status_data = service . get_server_status path_params
5454 config_data = service . get_server_config path_params
5555 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
5865 end
59-
6066 raise ( e )
6167 else
6268 data = status_data . merge ( config_data ) . merge ( node : node_id , vmid : id )
You can’t perform that action at this time.
0 commit comments