diff --git a/SharedSources/MediaLibraryService.swift b/SharedSources/MediaLibraryService.swift
index 09645138733710dd9d855f67bf36c02bead22842..219f15243198f9d54994c8f3ee34a62077893138 100644
--- a/SharedSources/MediaLibraryService.swift
+++ b/SharedSources/MediaLibraryService.swift
@@ -662,3 +662,18 @@ extension MediaLibraryService {
         }
     }
 }
+
+// MARK: - VLCMediaLibraryDelegate - Exception handling
+
+extension MediaLibraryService {
+    func medialibrary(_ medialibrary: VLCMediaLibrary,
+                      unhandledExceptionWithContext context: String,
+                      errorMessage: String, clearSuggested: Bool) -> Bool {
+        if clearSuggested {
+            medialib.clearDatabase(restorePlaylists: true)
+            setupMediaLibrary()
+            return true
+        }
+        return false
+    }
+}