Create a User federation

I want to create a new User-federation in Keycloak. I use the example of dasnike: this works fine.
But I have the problem, that the programm gets an “java.lang.RuntimeException”, if the user is not found, a null value is passed. how do I tell keycloak that in such a case it should bring an error message to the surface, as if an incorrect password is entered (user not available …).