when you validate the hash you make sure that is unique, but what if the hash that the UrlHasher class creates is already in the database? You throw a ValidationException and returns back to the user without telling him what went wrong. What you should have done is making sure that the LittleService class gets a unique hash from the UrlHasher before trying to inject it in the database.
when you validate the hash you make sure that is unique, but what if the hash that the UrlHasher class creates is already in the database? You throw a ValidationException and returns back to the user without telling him what went wrong. What you should have done is making sure that the LittleService class gets a unique hash from the UrlHasher before trying to inject it in the database.