Code cleanup (#427)
* Removed dead code. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix sonar issues. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -10,8 +10,10 @@ package org.eclipse.hawkbit.amqp;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.exception.InvalidTargetAddressException;
|
||||
import org.eclipse.hawkbit.repository.exception.TenantNotExistException;
|
||||
import org.eclipse.hawkbit.repository.exception.ToManyAttributeEntriesException;
|
||||
import org.eclipse.hawkbit.repository.exception.TooManyStatusEntriesException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -40,8 +42,7 @@ public class DelayedRequeueExceptionStrategy extends ConditionalRejectingErrorHa
|
||||
|
||||
@Override
|
||||
protected boolean isUserCauseFatal(final Throwable cause) {
|
||||
if (cause instanceof TenantNotExistException || cause instanceof TooManyStatusEntriesException
|
||||
|| cause instanceof InvalidTargetAddressException) {
|
||||
if (invalidMessage(cause)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,4 +57,13 @@ public class DelayedRequeueExceptionStrategy extends ConditionalRejectingErrorHa
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean invalidMessage(final Throwable cause) {
|
||||
return doesNotExist(cause) || cause instanceof TooManyStatusEntriesException
|
||||
|| cause instanceof InvalidTargetAddressException || cause instanceof ToManyAttributeEntriesException;
|
||||
}
|
||||
|
||||
private boolean doesNotExist(final Throwable cause) {
|
||||
return cause instanceof TenantNotExistException || cause instanceof EntityNotFoundException;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user