Skip to content

solution#675

Open
VictoriaMrkvch wants to merge 2 commits into
mate-academy:masterfrom
VictoriaMrkvch:solution
Open

solution#675
VictoriaMrkvch wants to merge 2 commits into
mate-academy:masterfrom
VictoriaMrkvch:solution

Conversation

@VictoriaMrkvch
Copy link
Copy Markdown

No description provided.

Comment on lines +16 to +26
public Driver login(String login, String password) {
Optional<Driver> driver = driverDao.findByLogin(login);
try {
if (driver.get().getPassword().equals(password)) {
return driver.get();
}
} catch (Exception e) {
throw new DataProcessingException("Login or password was incorrect", e);
}
throw new DataProcessingException("Login or password was incorrect",
new RuntimeException());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets refactor this method to throw an exception in 1 place. You should not use DataProcessingException here. DataProcessingException is for dao layer

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

Successfully merging this pull request may close these issues.

3 participants