add documentation for onError methods