private void trySizeAddition(long size) throws OverQuotaException { Quota<QuotaSize> afterAdditionQuotaSize = sizeQuota.addValueToQuota(QuotaSize.size(size)); if (afterAdditionQuotaSize.isOverQuota()) { throw new OverQuotaException( "You use too much space in " + quotaRoot.getValue(), afterAdditionQuotaSize.getLimit(), afterAdditionQuotaSize.getUsed()); } }
SetError.builder() .type(SetError.Type.MAX_QUOTA_REACHED) .description(e.getMessage()) .build()); } catch (MailboxException | IOException | MessagingException e) {
.mdnNotSent(MDNCreationEntry.getCreationId(), SetError.builder() .description(e.getMessage()) .type(SetError.Type.MAX_QUOTA_REACHED) .build());
private void tryCountAddition(long count) throws OverQuotaException { Quota<QuotaCount> afterAdditionQuotaCount = messageQuota.addValueToQuota(QuotaCount.count(count)); if (afterAdditionQuotaCount.isOverQuota()) { throw new OverQuotaException( "You have too many messages in " + quotaRoot.getValue(), messageQuota.getLimit(), messageQuota.getUsed()); } }
SetError.builder() .type(SetError.Type.MAX_QUOTA_REACHED) .description(e.getMessage()) .build());