zbiljic / failure

Failure is a Java library for machine-readable details of errors in a HTTP response

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure

Failure is a library for machine-readable details of errors in a HTTP response. It comes with an extensible set of implementations as well as convenient functions for every day use.

It's decoupled from any JSON library, but contains a separate module for Jackson.

Dependency

<dependency>
    <groupId>com.zbiljic</groupId>
    <artifactId>failure</artifactId>
    <version>${failure.version}</version>
</dependency>

<dependency>
    <groupId>com.zbiljic</groupId>
    <artifactId>jackson-datatype-failure</artifactId>
    <version>${failure.version}</version>
</dependency>

Usage

In case you're using Jackson, make sure you register the module.

ObjectMapper mapper = new ObjectMapper();

mapper.registerModule(new Jdk8Module());
mapper.registerModule(new FailureModule());
// or
mapper.findAndRegisterModules();

IMPORTANT: The FailureModule requires the Jdk8Module to work.


Copyright © 2016 Nemanja Zbiljić

About

Failure is a Java library for machine-readable details of errors in a HTTP response

License:Apache License 2.0


Languages

Language:Java 100.0%