Add collection view as an exception param and capture data source state on crash

Summary:
Adding more metadata about the state of the data source at the time of crash.

Note that this will be a breaking change to the public repo, but it's on a much-less used API, and since this is very high-pri for us at the moment, I'm willing to make the breakage.

Reviewed By: manicakes

Differential Revision: D6863683

fbshipit-source-id: e979aea445abc1ea556182cb69758703499e161a
This commit is contained in:
Ryan Nystrom 2018-01-31 15:10:47 -08:00 committed by Facebook Github Bot
parent f55b6d2895
commit 64676d5907
2 changed files with 3 additions and 0 deletions

View file

@ -222,6 +222,7 @@
}
} @catch (NSException *exception) {
[delegate listAdapterUpdater:self
collectionView:collectionView
willCrashWithException:exception
fromObjects:fromObjects
toObjects:toObjects

View file

@ -129,12 +129,14 @@ NS_SWIFT_NAME(ListAdapterUpdaterDelegate)
Notifies the delegate that the collection view threw an exception in `-[UICollectionView performBatchUpdates:completion:]`.
@param listAdapterUpdater The adapter updater owning the transition.
@param collectionView The collection view being updated.
@param exception The exception thrown by the collection view.
@param fromObjects The items transitioned from in the diff, if any.
@param toObjects The items transitioned to in the diff, if any.
@param updates The batch updates that were applied to the collection view.
*/
- (void)listAdapterUpdater:(IGListAdapterUpdater *)listAdapterUpdater
collectionView:(UICollectionView *)collectionView
willCrashWithException:(NSException *)exception
fromObjects:(nullable NSArray *)fromObjects
toObjects:(nullable NSArray *)toObjects