[O] More logging

This commit is contained in:
Azalea
2024-03-03 00:47:57 -05:00
parent 32eb98361a
commit 4a5bd3135f
3 changed files with 19 additions and 4 deletions

View File

@@ -30,7 +30,10 @@ annotation class Doc(
// Make it easier to throw a ResponseStatusException
operator fun HttpStatus.invoke(message: String? = null): Nothing = throw ApiException(value(), message ?: this.reasonPhrase)
operator fun Int.minus(message: String): Nothing = throw ApiException(this, message)
operator fun Int.minus(message: String): Nothing {
ApiException.log.info("> Error $this: $message")
throw ApiException(this, message)
}
// Email validation
// https://www.baeldung.com/java-email-validation-regex