Jump to content

User-friendly errors for registrar module


Recommended Posts

According to the documentation, user-friendly errors will only be shown to administrators: https://developers.whmcs.com/domain-registrars/module-functions/

Quote

User-friendly error messages are exposed to administrators within the Admin Area. User-friendly error messages are never exposed to clients within the Client Area to protect the potentially sensitive nature of the message being returned.

Is there no way to work around this? Creating your own custom error messages really would be great. It also wouldn't be an issue making sure that no sensitive information is shown to the client.

An example:
User tries to change their name servers to ns1.example.com, ns2.example.com and ns3.example.com. WHMCS just shows the general "An issue was encountered while updating the domain nameservers. Please contact support" message.
The registry requires the name servers to be registered in their system, and ns1-n3.example.com are not registered. The registry would return an error code (eg. 2400) because the registry aren't aware of these name servers. We should be able to catch the error code and return a string like "Name server x is not known."

To fix the error, the name server administrator registers their name servers with the registry. User then tries to change their name servers again but the registry also performs a name server check to see if the domain name exists on the name servers. Unfortunately, it doesn't. The registry returns another error code (eg. 2303). We can return "No DNS zone on name servers for domain" or something like that to the user.
If the registry returns an error code that we're not catching, WHMCS would return a general error.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated