Index: Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs =================================================================== diff -u -r003c0b0d85b08cd50c56f29ec9539e973a5bd7c1 -r1d86c8daf73d71b72c7a105b5f564ae7480a8d7f --- Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs (.../StorageSqLite.cs) (revision 003c0b0d85b08cd50c56f29ec9539e973a5bd7c1) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs (.../StorageSqLite.cs) (revision 1d86c8daf73d71b72c7a105b5f564ae7480a8d7f) @@ -24,6 +24,7 @@ using System.Data.Entity; using System.IO; using System.Linq; +using System.ServiceModel; using Application.Ringtoets.Storage.Create; using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Exceptions; @@ -169,12 +170,19 @@ return true; } - using (var dbContext = new RingtoetsEntities(connectionString)) + try { - byte[] originalHash = dbContext.VersionEntities.Select(v => v.FingerPrint).First(); - byte[] hash = FingerprintHelper.Get(stagedProjectEntity); - return !FingerprintHelper.AreEqual(originalHash, hash); + using (var dbContext = new RingtoetsEntities(connectionString)) + { + byte[] originalHash = dbContext.VersionEntities.Select(v => v.FingerPrint).First(); + byte[] hash = FingerprintHelper.Get(stagedProjectEntity); + return !FingerprintHelper.AreEqual(originalHash, hash); + } } + catch (QuotaExceededException e) + { + throw new StorageException("Het project bevat te veel unieke objecten om een digitale vingerafdruk van te genereren.", e); + } } private void ValidateDatabaseVersion(RingtoetsEntities ringtoetsEntities, string databaseFilePath) @@ -226,13 +234,17 @@ } catch (DataException exception) { - throw CreateStorageWriterException(databaseFilePath, Resources.Error_Update_Database, exception); + throw CreateStorageWriterException(databaseFilePath, Resources.Error_saving_database, exception); } + catch (QuotaExceededException exception) + { + throw CreateStorageWriterException(databaseFilePath, exception.Message, exception); + } catch (SystemException exception) { if (exception is InvalidOperationException || exception is NotSupportedException) { - throw CreateStorageWriterException(databaseFilePath, Resources.Error_During_Connection, exception); + throw CreateStorageWriterException(databaseFilePath, Resources.Error_during_connection, exception); } throw; }