Skip to content

Instantly share code, notes, and snippets.

View cmicali's full-sized avatar

Chris Micali cmicali

View GitHub Profile
@cmicali
cmicali / pom.xml
Last active August 29, 2015 13:56
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>Dropwizard Test</name>
<groupId>com.sagedevices.dropwizard</groupId>
<artifactId>dropwizard-test</artifactId>
package com.sagedevices.platform.jersey.core;
import com.sagedevices.platform.api.util.StringUtil;
public class RequestId {
public static final String HEADER_NAME_ORIGIN = "X-Origin-Request-Id";
public static final String HEADER_NAME_LOCAL = "X-Local-Request-Id";
public static final String MDC_NAME_LOCAL = "LocalRequestId";
/**
* Replaces the DropWizard exception mappers with our own mappers that return exceptions in JSON format
* @param environment
*/
private void configureExceptionMappers(Environment environment) {
ResourceConfig jrConfig = environment.jersey().getResourceConfig();
Set<Object> dwSingletons = jrConfig.getSingletons();
List<ExceptionMapper> singletonsToRemove = new ArrayList<>();