RESTEasy Exception Chains

Library for serializing exceptions and relaying them to a client

Лицензия

Лицензия

Категории

Категории

RESTEasy Межпрограммное взаимодействие REST Frameworks
Группа

Группа

uk.ac.cam.cl.dtg.web
Идентификатор

Идентификатор

resteasy-exception-chains
Последняя версия

Последняя версия

1.0.10
Дата

Дата

Тип

Тип

jar
Описание

Описание

RESTEasy Exception Chains
Library for serializing exceptions and relaying them to a client
Ссылка на сайт

Ссылка на сайт

https://github.com/ucam-cl-dtg/resteasy-exception-chains
Система контроля версий

Система контроля версий

https://github.com/ucam-cl-dtg/resteasy-exception-chains.git

Скачать resteasy-exception-chains

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/uk.ac.cam.cl.dtg.web/resteasy-exception-chains/ -->
<dependency>
    <groupId>uk.ac.cam.cl.dtg.web</groupId>
    <artifactId>resteasy-exception-chains</artifactId>
    <version>1.0.10</version>
</dependency>
// https://jarcasting.com/artifacts/uk.ac.cam.cl.dtg.web/resteasy-exception-chains/
implementation 'uk.ac.cam.cl.dtg.web:resteasy-exception-chains:1.0.10'
// https://jarcasting.com/artifacts/uk.ac.cam.cl.dtg.web/resteasy-exception-chains/
implementation ("uk.ac.cam.cl.dtg.web:resteasy-exception-chains:1.0.10")
'uk.ac.cam.cl.dtg.web:resteasy-exception-chains:jar:1.0.10'
<dependency org="uk.ac.cam.cl.dtg.web" name="resteasy-exception-chains" rev="1.0.10">
  <artifact name="resteasy-exception-chains" type="jar" />
</dependency>
@Grapes(
@Grab(group='uk.ac.cam.cl.dtg.web', module='resteasy-exception-chains', version='1.0.10')
)
libraryDependencies += "uk.ac.cam.cl.dtg.web" % "resteasy-exception-chains" % "1.0.10"
[uk.ac.cam.cl.dtg.web/resteasy-exception-chains "1.0.10"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.jboss.resteasy : resteasy-jaxrs jar 3.0.8.Final
org.jboss.resteasy : resteasy-jackson2-provider jar 3.0.8.Final
org.slf4j : slf4j-api jar 1.7.7

provided (1)

Идентификатор библиотеки Тип Версия
javax.servlet : javax.servlet-api jar 3.0.1

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 3.8.1

Модули Проекта

Данный проект не имеет модулей.

resteasy-exception-chains

This is a small library to provide a uniform mechanism for throwing and catching exceptions through a resteasy api. The intention is to standardise error handling within applications and to make debugging easier by propagating remote errors all the way back to the client.

The central idea is provided by the SerializableException class. This class implements Exception and is designed to be seralizable to and from JSON (you can't do this with a normal exception class). Users of this library should register the ExceptionHandler class with their resteasy application. ExceptionHandler is responsible for catching all Throwables from the application, wrapping them in SerializableException and passing this to the client.

One benefit of a standardised serialised exception is that you can automatically chain exception information across remote API calls. You do this by registering RemoteFailureHandler with your application. For example:

    ResteasyClient c = new ResteasyClientBuilder().build();
    ResteasyWebTarget t = c.target("http://remote.com/api");
    ExampleApi proxy = t.proxy(ExampleApi.class);
    Item item = proxy.fetchItem("item1");
    return item;

When the proxy call is made we cause the remote server to execute code. If this throws an exception this is serialised into JSON and returned to us. This causes the proxy object to throw an exception which is captured in turn by RemoteFailureHandler. RemoteFailureHandler then extracts the original cause and serialises a further exception to return to the client.

Usage

Include this library in your class path and register ExceptionHandler and RemoteFailureHandler with your application.

uk.ac.cam.cl.dtg.web

Digital Technology Group, Computer Laboratory, University of Cambridge

Версии библиотеки

Версия
1.0.10