When RDAP server returns a protocol error, such as:
{
"errorCode": 429,
"title": "Error in processing request",
"description": [
"Server is busy now, please try again later.",
"Too Many Requests"
],
"lang": "en"
}
it results in
InvalidDataTypeException: Response is not valid json content
client fails to assert that due to
|
if (!is_array($responseJson) || !is_string($responseJson['objectClassName']??null)) { |
|
throw new InvalidDataTypeException( |
|
'Response is not valid json content' |
|
); |
objectClassName is not in the response data.
Better to check for rdapConformance that always is in the response of any kind.
But actually best would be to throw a response exception with received code and description.
When RDAP server returns a protocol error, such as:
{ "errorCode": 429, "title": "Error in processing request", "description": [ "Server is busy now, please try again later.", "Too Many Requests" ], "lang": "en" }it results in
client fails to assert that due to
RDAP-Client/src/Response/Abstracts/AbstractResponse.php
Lines 77 to 80 in d1d4f8f
objectClassNameis not in the response data.Better to check for
rdapConformancethat always is in the response of any kind.But actually best would be to throw a response exception with received code and description.