Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrizzio-dotCMS committed Aug 15, 2024
1 parent 2f49ebf commit 2cbf130
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.dotcms.rest.exception.mapper;

import com.dotcms.rest.exception.BadRequestException;
import javax.ws.rs.ext.Provider;

@Provider
public class DefaultDotBadRequestExceptionMapper extends DotBadRequestExceptionMapper<BadRequestException> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import com.dotmarketing.util.Logger;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.Provider;
import org.elasticsearch.ElasticsearchStatusException;
import javax.ws.rs.ext.ExceptionMapper;

@Provider
public class ElasticsearchStatusExceptionMapper implements ExceptionMapper<ElasticsearchStatusException> {


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
@Provider
public class JsonMappingExceptionMapper implements ExceptionMapper<JsonMappingException> {

private final static Set<Class<? extends Throwable>> EXCEPTIONS =
ImmutableSet.of(WebApplicationException.class, ValidationException.class, BadRequestException.class, HttpStatusCodeException.class);
private static final Set<Class<? extends Throwable>> EXCEPTIONS =
Set.of(WebApplicationException.class, ValidationException.class, BadRequestException.class, HttpStatusCodeException.class);

@Override
public Response toResponse(final JsonMappingException exception)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import com.dotmarketing.util.SecurityLogger;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.Provider;

/**
* Mapper for {@link NotAllowedException}
*/
@Provider
public class NotAllowedExceptionMapper
implements javax.ws.rs.ext.ExceptionMapper<NotAllowedException> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import com.dotcms.contenttype.exception.NotFoundInDbException;
import javax.ws.rs.core.Response;
import com.dotmarketing.util.SecurityLogger;
import javax.ws.rs.ext.Provider;

/**
* Mapper for {@link NotFoundInDbException}
*/
@Provider
public class NotFoundInDbExceptionMapper
implements javax.ws.rs.ext.ExceptionMapper<NotFoundInDbException> {

Expand Down

0 comments on commit 2cbf130

Please sign in to comment.