feature: add bank account exceptions

This commit is contained in:
Alexander
2022-04-15 12:07:21 +03:00
parent d56dfa6208
commit 995b1c5457
3 changed files with 22 additions and 1 deletions

View File

@@ -26,7 +26,6 @@ public class BankAccountController {
@GetMapping("{aggregateId}")
public ResponseEntity<BankAccountResponseDTO> getBankAccount(@PathVariable String aggregateId) {
final var query = new GetBankAccountByIDQuery(aggregateId);
log.info("GET bank account query: {}", query);
final var result = queryService.handle(query);
log.info("GET bank account result: {}", result);
return ResponseEntity.ok(result);

View File

@@ -0,0 +1,11 @@
package com.eventsourcing.bankAccount.exceptions;
public class InvalidAddressException extends RuntimeException {
public InvalidAddressException() {
super();
}
public InvalidAddressException(String address) {
super("invalid address: " + address);
}
}

View File

@@ -0,0 +1,11 @@
package com.eventsourcing.bankAccount.exceptions;
public class InvalidEmailException extends RuntimeException {
public InvalidEmailException() {
super();
}
public InvalidEmailException(String email) {
super("invalid email address: " + email);
}
}