throws an error if the provider interface is not a function