Raise valid exception when handler has wrong type