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.