Skip to content

Commit

Permalink
chore: remove WrappedRegistryException
Browse files Browse the repository at this point in the history
  • Loading branch information
jsenko committed Sep 14, 2023
1 parent e852e0d commit 9df9d42
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import io.apicurio.registry.services.DisabledApisMatcherService;
import io.apicurio.registry.services.http.ErrorHttpResponse;
import io.apicurio.registry.services.http.RegistryExceptionMapperService;
import io.apicurio.registry.types.WrappedRegistryException;
import io.apicurio.tenantmanager.api.datamodel.TenantStatusValue;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
Expand Down Expand Up @@ -153,10 +152,6 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha

private void mapException(ServletResponse response, Throwable throwable) throws IOException {

if (throwable instanceof WrappedRegistryException) {
throwable = ((WrappedRegistryException) throwable).getWrapped();
}

ErrorHttpResponse res = exceptionMapper.mapException(throwable);
HttpServletResponse httpResponse = (HttpServletResponse) response;
httpResponse.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.apicurio.registry.services.http.ErrorHttpResponse;
import io.apicurio.registry.services.http.RegistryExceptionMapperService;
import io.apicurio.registry.storage.error.*;
import io.apicurio.registry.types.WrappedRegistryException;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -80,10 +79,6 @@ public class RegistryExceptionMapper implements ExceptionMapper<Throwable> {
@Override
public Response toResponse(Throwable t) {

if (t instanceof WrappedRegistryException) {
t = ((WrappedRegistryException) t).getWrapped();
}

ErrorHttpResponse res = exceptionMapper.mapException(t);

Response.ResponseBuilder builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import io.apicurio.common.apps.config.DynamicConfigStorage;
import io.apicurio.registry.storage.error.ReadOnlyStorageException;
import io.apicurio.registry.types.Current;
import io.apicurio.registry.types.WrappedRegistryException;
import io.apicurio.registry.utils.Functional.Runnable1Ex;
import io.apicurio.registry.utils.tests.ApicurioTestTags;
import io.quarkus.test.junit.QuarkusTest;
Expand Down Expand Up @@ -195,9 +194,6 @@ private void notEnabled() {
try {
state.runnable.run(storage);
} catch (Exception ex) {
if (ex instanceof WrappedRegistryException) {
ex = ((WrappedRegistryException) ex).getWrapped();
}
if (ex instanceof ReadOnlyStorageException) {
Assertions.fail("Unexpected ReadOnlyStorageException for method " + method + " (read-only is not enabled).", ex);
}
Expand All @@ -219,9 +215,6 @@ private void enabled() {
Assertions.fail("Expected ReadOnlyStorageException for method " + method + " (read-only is enabled).");
}
} catch (Exception ex) {
if (ex instanceof WrappedRegistryException) {
ex = ((WrappedRegistryException) ex).getWrapped();
}
if (ex instanceof ReadOnlyStorageException) {
if (!state.writes) {
Assertions.fail("Unexpected ReadOnlyStorageException for method " + method + " (read-only is enabled).", ex);
Expand Down

This file was deleted.

0 comments on commit 9df9d42

Please sign in to comment.