Closed joveice closed 5 years ago
For Norid-specific "conditions", see getExt...
functions here. This response trait is included in all responses to Norid-specific requests, not generic EPP requests. https://github.com/metaregistrar/php-epp-client/blob/4fad2531e74e49fcf20a5e96178324e82e728090/Protocols/EPP/eppExtensions/no-ext-result-1.0/eppResponses/noridEppResponseTrait.php#L6-L45
Otherwise if you are after the RFC5730 <epp:result>
content, see getResult...
functions here. https://github.com/metaregistrar/php-epp-client/blob/4fad2531e74e49fcf20a5e96178324e82e728090/Protocols/EPP/eppResponses/eppResponse.php#L213-L296
@alexrsagen Not sure how I should do that, this is what throws the exception
$response = $conn->request($contact);
So I tried to catch it on that, but I'm not able to assign my $response when the exception is thrown?
you could make an extra try/catch block around the part that throws the exception that you specifically want to catch...
Right. An eppException
is thrown whenever the status code is non-successful, which is not really helpful for trying to get the actual reason behind it.
Here is a function of eppException
which lets you get a custom-formatted string of the EPP error message (not Norid-specific conditions) https://github.com/metaregistrar/php-epp-client/blob/4fad2531e74e49fcf20a5e96178324e82e728090/Protocols/EPP/eppException.php#L55-L60
This function is responsible for throwing the eppException
. https://github.com/metaregistrar/php-epp-client/blob/4fad2531e74e49fcf20a5e96178324e82e728090/Protocols/EPP/eppResponses/eppResponse.php#L120-L195
If you want to get the Norid-specific conditions, we may have to modify eppException
to allow you to still get the response through a method.
@metaregistrar Not sure what you meant there?
@alexrsagen Yea I tried the getReason but it's not set so it only contains a null. I guess a modify will be needed? I don't know whats best practice here for clean code nor do I have time to look at it right now as I need to finish the functional part of what I'm working on before "nice to have" can come.
Yeah, no wonder it's null. getReason
returns the value of <epp:reason>
, which is not provided by Norid.
Will have to add some kind of a function like getResponse
so you can still get the response. I'm busy right now, so I can't do that for you.
Okey, well I don't need it now, it's just nice to have, I don't have access to Norid at private so I can't really do much there. I'll see if I can do it when I'm done, trying to improve security is pri 1.
I can't really find a good way to implement this, I tried to just include the response with the exception, but I don't know if this is a good way to do it, we probably would like a norid specific way for this and not a global one right?
A global method named getResponse
on eppException would be fine. Should add the original eppResponse
instance to the eppException
whenever an error is thrown from the Success
method.
Okey, I made that pr, works out great if I just search the xpath after the exception is thrown.
I believe it's related / the same as #149 Tho the xml responses look different When I get an exception I'm not able to grab the reason behind it from the eppException which is thrown.
Is it possible to get this implemented / or if there already is one?
Hope you do not mind me mentioning you since you had much control on Norid. @alexrsagen if you know something about this?
Etc
and a multi one