Closed osopromadze closed 4 years ago
Hello @osopromadze, thank you very much for this PR! It looks great at a first glance. We will review it in the next few days and give an answer at the beginning of next week.
Great @chaoran-chen, thanks for letting me know 👍
Hi. Would it be possible to remove projectlombok from the dependencies since we are also not using it in the other classes? But the library is very nice and maybe we will introduce it consistently for the whole project at a later point in time.
Hi. Would it be possible to remove projectlombok from the dependencies since we are also not using it in the other classes? But the library is very nice and maybe we will introduce it consistently for the whole project at a later point in time.
Yes, no problem, Just added project lombok to easily generate constructros, or getters and setters. Can be removed easily and write code without it.
The import in
src/test/java/science/icebreaker/device_availability/DeviceAvailabilityServiceTest.java#20
needs to be adapted since theDeviceAvailabilityCreationException
was moved. And for consistency,DeviceAvailabilityNotFoundException
should also be moved to thescience.icebreaker.exception
package.
@chaoran-chen done. All tests passed and moved DeviceAvailabilityNotFoundException
in exception package.
fixes #32
Moved all exceptions into the same package. They are extended from BaseException class. Created messages.properties in resources/i18n folder, and exceptions get error messages from that file. Created global exception handler class and there is constructing final output error object with status code, timestamp and message.