Create a User federation

Hello,
I want to create a new User-federation in Keycloak. I use the example of dasnike: https://github.com/dasniko/keycloak-user-spi-demo#notification-settings 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 …).

Greetings