Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jackson exceptions should be Jackson-serializable #1370

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
Create TestJsonMappingException.java
  • Loading branch information
jecaplan authored Sep 12, 2016
commit 3fc9886566525e995f716845ba148f9a546548e1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.fasterxml.jackson.databind;

import java.io.IOException;

import org.junit.Test;

public class TestJsonMappingException {
public static class NoSerdeConstructor {
private String strVal;
public String getVal() { return strVal; }
public NoSerdeConstructor( String strVal ) {
this.strVal = strVal;
}
}
@Test
public void test() throws IOException {
ObjectMapper mpr = new ObjectMapper();
try {
mpr.readValue( "{ \"val\": \"foo\" }", NoSerdeConstructor.class );
} catch ( JsonMappingException exc ) {
mpr.writeValueAsString( exc );
}
}
}