add account not found exception

- update balance in AccountController with onErrorResume
- update AccountService
  - update getForUpdateById with switchIfEmpty
  - update getById with switchIfEmpty
- add AccountNotFoundException
This commit is contained in:
2025-09-11 18:49:16 +02:00
parent 25f534b6e3
commit e46bf55232
5 changed files with 56 additions and 6 deletions

View File

@@ -39,6 +39,6 @@ class AccountController(
@PathVariable account: UUID,
): Mono<Account.Response> = accountService.getById(account)
.map { it.toResponse() }
.switchIfEmpty(Mono.error(ResponseStatusException(NOT_FOUND)))
.onErrorResume { Mono.error(ResponseStatusException(NOT_FOUND)) }
.doOnError { log.debug { "account $account not found for balance" } }
}