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

Improve error messages #580

Open
artur-intech opened this issue Aug 20, 2017 · 3 comments
Open

Improve error messages #580

artur-intech opened this issue Aug 20, 2017 · 3 comments

Comments

@artur-intech
Copy link
Contributor

artur-intech commented Aug 20, 2017

Real-world example of the problem:

Given

  • DB column contacts.country_code (which contains postal address country code) has some value that has lost its validity over time (ISO 3166-1 alpha-2 may be deleted or reassigned)
  • The rest of contact's attributes are valid

When

  • I update that contact via EPP contact:update with valid data but don't specify postal address country code

Then

  • As an EPP user I should get
    Postal address country code in our database in invalid. Please provide us valid data to proceed
    ("database" should be substituted with some abstract meaning)

When

  • I update that contact via EPP contact:update with valid data and provide invalid postal address country code (say "RUSUS")

Then

  • As an EPP user I should get
    Submitted postal address country code in invalid

Same principle should apply to any attribute of a domain or contact.

Open questions:

  • Can we use same error message throughout the application (EPP, REST API, admin/registrar/registrant areas, rails c) or it's needed to decouple EPP and ActiveRecord messages.

Currently ActiveRecord messages are hard to read:

irb(main):003:0> c = Contact.new
irb(main):004:0> c.validate
irb(main):005:0> c.errors.full_messages
=> ["Name Required parameter missing - name", "Email Required parameter missing - email", "Email Email is invalid", "Email Email is invalid", "Phone Required parameter missing - phone", "Phone Phone nr is invalid"]
@artur-intech artur-intech changed the title Improve EPP error messages Improve application and EPP error messages Aug 20, 2017
@artur-intech artur-intech changed the title Improve application and EPP error messages Improve error messages (EPP, application) Aug 20, 2017
@teadur
Copy link
Contributor

teadur commented Sep 25, 2017

In what sitsuation would you get errors like that from contact in real life deployment, epp doesnot allow creating such object, only way to get such an object is from rails console.
Or i dont understand the problem correctly ?

@artur-intech
Copy link
Contributor Author

artur-intech commented Feb 27, 2018

epp doesnot allow creating such object

What "such"? Contact.new is one of the standard ways to create new contact in our application. The point of this ticket to review all error messages we show to the users (incl. users of our API). I am not sure if there should be some boundary between default ActiveRecord messages and EPP.

P.S. By API I mean the interface our objects provide, not REST API

@artur-intech artur-intech changed the title Improve error messages (EPP, application) Improve error messages Mar 1, 2018
@artur-intech
Copy link
Contributor Author

artur-intech commented Mar 1, 2018

@vohmar Ticket's objective needs your review

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

No branches or pull requests

2 participants