Consider that you have the following custom exception class:
class InvalidCredentialsException : Exception()
And a Status Pages configuration with the following code:
exception<InvalidCredentialsException> { call, cause ->
call.respondText(
text = "401: Invalid credentials", status = HttpStatusCode.Unauthorized
)
}
How do you raise an exception that will be caught by this handler?