Check that onError is a Function