Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response code definitions #22

Open
pavkatar opened this issue May 24, 2016 · 2 comments
Open

Response code definitions #22

pavkatar opened this issue May 24, 2016 · 2 comments

Comments

@pavkatar
Copy link
Contributor

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';
@lifeofguenter
Copy link
Member

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 lifeofguenter added this to the 0.1.7 milestone May 25, 2016
@lifeofguenter lifeofguenter removed this from the 0.1.7 milestone Apr 27, 2017
@johnny-bit
Copy link
Collaborator

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants