Modifiche ad aggiunta record DNS

This commit is contained in:
Fabio Giacomoni
2021-11-02 15:46:49 +01:00
parent 30f7fc050e
commit 4df937f767

View File

@@ -67,8 +67,23 @@ class DNS implements API
$user = $this->adapter->post('zones/' . $zoneID . '/dns_records', $options);
$this->body = json_decode($user->getBody());
$result = $this->body->result;
if( !( $result instanceof \stdClass ) ) {
$errorMessage = '';
if( is_array( $result ) ) {
$errorMessage.= implode( $result );
} elseif( is_string( $result ) ) {
$errorMessage.= $result;
}
throw new EndpointException( sprintf( 'Unexpected add record result. %s', $errorMessage ) );
}
return $this->body->result;
return $result;
}
public function listRecords(