Fix upload quota check and provide better error message (#893)
* Adjusted upload quota check to include file size and show proper error message Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Fixed failing upload quota tests Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Moved quota check to stream, fixed review findings Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Added missing license header to QuotaInputStream Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Reworked uploadLock, ensured error messages may be translated, review fixes Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Added local artifactrepo to gitignore Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Fixed sonar issues and assignment quota message Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * PR review fixes Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Split quota exceptions, PR fixes Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Removed left over conversion method in quota helper Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com> * Made conversion helper class final Signed-off-by: Alexander Dobler <alexander.dobler3@bosch-si.com>
This commit is contained in:
committed by
Dominic Schabel
parent
9b8ab40c55
commit
09f2d8a481
@@ -14,7 +14,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.validation.ValidationException;
|
||||
|
||||
import org.eclipse.hawkbit.repository.exception.QuotaExceededException;
|
||||
import org.eclipse.hawkbit.repository.exception.AssignmentQuotaExceededException;
|
||||
import org.eclipse.hawkbit.repository.exception.RolloutIllegalStateException;
|
||||
import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
@@ -78,7 +78,7 @@ public final class RolloutHelper {
|
||||
if (amountGroup <= 0) {
|
||||
throw new ValidationException("The amount of groups cannot be lower than zero");
|
||||
} else if (amountGroup > quotaManagement.getMaxRolloutGroupsPerRollout()) {
|
||||
throw new QuotaExceededException(
|
||||
throw new AssignmentQuotaExceededException(
|
||||
"The amount of groups cannot be greater than " + quotaManagement.getMaxRolloutGroupsPerRollout());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user