php-epp2 icon indicating copy to clipboard operation
php-epp2 copied to clipboard

Response code definitions

Open pavkatar opened this issue 9 years ago • 2 comments

I suggest adding response code definitions (constants) for better understanding of the received number. Maybe the Client class would be the best place for this.

Example: (Taken from the other epp library)

const RESULT_SUCCESS = '1000';
const RESULT_SUCCESS_ACTION_PENDING = '1001';
const RESULT_NO_MESSAGES = '1300';
const RESULT_MESSAGE_ACK = '1301';
const RESULT_LOGOFF_SUCCESS = '1500';
#
# ERROR RESPONSES
#
const RESULT_UNKNOWN_COMMAND = '2000';
const RESULT_SYNTAX_ERROR = '2001';
const RESULT_USE_ERROR = '2002';
const RESULT_PARAMETER_MISSING = '2003';
const RESULT_PARAMETER_RANGE_ERROR = '2004';
const RESULT_PARAMETER_ERROR = '2005';
const RESULT_INVALID_PROTOCOL_VERSION = '2100';
const RESULT_INVALID_COMMAND = '2101';
const RESULT_INVALID_OPTION = '2102';
const RESULT_INVALID_EXTENSION = '2103';
const RESULT_BILLING_FAILURE = '2104';
const RESULT_NO_RENEW_POSSIBLE = '2105';
const RESULT_NO_TRANSFER_POSSIBLE = '2106';
const RESULT_AUTHENTICATION_ERROR = '2200';
const RESULT_AUTHORIZATION_ERROR = '2201';
const RESULT_INVALID_AUTHINFO = '2202';
const RESULT_TRANSFER_PENDING = '2300';
const RESULT_TRANSFER_NOT_PENDING = '2301';
const RESULT_ALREADY_EXISTS = '2302';
const RESULT_NOT_EXISTS = '2303';
const RESULT_OBJECT_STATUS_WRONG = '2304';
const RESULT_ASSOCIATION_EXISTS = '2305';
const RESULT_POLICY_ERROR = '2306';
const RESULT_UNIMPLEMENTED_SERVICE = '2307';
const RESULT_POLICY_VIOLATION = '2308';
const RESULT_COMMAND_FAILED = '2400';
const RESULT_COMMAND_FAILED_CONNECTION_CLOSE = '2500';
const RESULT_AUTHENTICATION_ERROR_CONNECTION_CLOSE = '2501';
const RESULT_SESSION_LIMIT_EXCEEDED_CONNECTION_CLOSE = '2502';

pavkatar avatar May 24 '16 12:05 pavkatar

In general I think this would be a great addition, but I'd like to to maybe go a further step. Replacing int response codes with classes will greatly improve the readability of the library, however I think we should also improve the way how we return those response codes to the user, e.g. ideally something human readable that can be fetched separately (something like $errno and $errstr)

PR's are welcome :)

lifeofguenter avatar May 25 '16 21:05 lifeofguenter

I wondered about this and it's a bit problematic IMHO. Or rather anti-problematic. Going by EPP standard, registries should return message along with code and do so in client selected language. So the mentioned const/classes May not actually be needed. What do you think @pavkatar @lifeofguenter ?

johnny-bit avatar Nov 01 '19 17:11 johnny-bit