Skip to content

Implement medialibrary's onUnhandledException callback

In recent medialibrary versions, a new callback was added: IMediaLibraryCb::onUnhandledException

The iOS application should implement it, as it will be called for various errors which are not explicitly caught on purpose (or not)

The minimal implementation should:

  • Check the 3rd parameter clearSuggested to see if a database clear is advised
  • Invoke IMediaLibrary::clearDatabase if advised (The medialib will take care of attempting to backup the playlists if true is being passed as restorePlaylists parameter

Since the appcenter provides the text associated with the unhandled exceptions, you don't need to have a manual bug reporter (but if you do, and include the database, I would be happy :D)

For what it's worth, implementing this callback will allow you to recover from such errors: https://appcenter.ms/orgs/videolan/apps/VLC-for-iOS-production/crashes/errors/207869758u/overview

Here, the database is reported as corrupted, so there's not much the medialib can do on its own. Instead, the application should request a clear, and the medialib will do what it can from there.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information