fix(ui): narrow delete-list FK catch to SqliteException
This commit is contained in:
@@ -107,8 +107,10 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
await lists.DeleteAsync(ListId);
|
||||
}
|
||||
catch (Exception ex) when (
|
||||
ex.Message.Contains("FOREIGN KEY", StringComparison.OrdinalIgnoreCase)
|
||||
|| ex.InnerException?.Message.Contains("FOREIGN KEY", StringComparison.OrdinalIgnoreCase) == true)
|
||||
(ex is Microsoft.Data.Sqlite.SqliteException
|
||||
|| ex.InnerException is Microsoft.Data.Sqlite.SqliteException)
|
||||
&& (ex.Message.Contains("FOREIGN KEY", StringComparison.OrdinalIgnoreCase)
|
||||
|| ex.InnerException?.Message.Contains("FOREIGN KEY", StringComparison.OrdinalIgnoreCase) == true))
|
||||
{
|
||||
if (ShowErrorAsync is not null)
|
||||
await ShowErrorAsync("This list has planning sessions with child tasks. Discard those first, then delete the list.");
|
||||
|
||||
Reference in New Issue
Block a user