-
Notifications
You must be signed in to change notification settings - Fork 12
task1 #1
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
base: master
Are you sure you want to change the base?
task1 #1
Conversation
| @@ -0,0 +1,7 @@ | |||
| package task_1.solution; | |||
|
|
|||
| public class TimeTravelException extends Exception { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше unchecked
extendes RuntimeException
| @@ -0,0 +1,25 @@ | |||
| package task_1.solution; | |||
|
|
|||
| public class TimeTraveler { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Рассмотреть использования lombok
|
|
||
| if (year < timeTraveler.getBirthYear()) { | ||
| throw new TimeTravelException("The year of travel to the past is less than the year of the traveler's " + | ||
| "birth."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавить информацию о путешественнике во времени
| @@ -0,0 +1,17 @@ | |||
| package task_1.solution; | |||
|
|
|||
| public class Main { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slf4j из lombok даст log объект
| timeMachine.travelInTime(traveler1, 2000); | ||
| timeMachine.travelInTime(traveler2, 2075); | ||
| } catch (TimeTravelException e) { | ||
| System.out.println("Произошла ошибка: " + e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не логируется stacktrace
No description provided.