Closed IngoStrauch2020 closed 1 year ago
I could imagine two easy ways to do it.
a) Change the one relevant code line to pass the final message
fun Response.extractLocationUUID(): UUID {
if (!isSuccessful()) {
throw KeycloakApiException("code=${this.status()}, response=${this.body().asReader().readText()})
}
...
}
b) add a second constructor to the KeycloakApiException to centralize the message generation for future use
class KeycloakApiException : RuntimeException {
constructor(message: String): super(message)
constructor(code: Int, message: String): super("code=$code, response=$message")
}
plus
fun Response.extractLocationUUID(): UUID {
if (!isSuccessful()) {
throw KeycloakApiException(this.status(), this.body().asReader().readText())
}
...
}
Hey Ingo, sry I forgot about this issue and only implemented it halfway through. I will get to it this week :)
Released with version 0.2.46 :) Maybe you could verify this works
Sorry, better late than never. It works, thanks!
It's maybe just a nice to have, but when e.g. the admin user executing a migration does not have the "manage-authorization" role and tries to use the "addFlow" migration, the error message is just
Calling the REST API with some other tool would show that the HTTP status code is 403 Forbidden, which is the relevant information here.
Maybe the log could be changed like this