You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Leandro D'Agostino <L....@pocos.nl> on 2019/01/23 14:11:30 UTC

Persistance errors are returned through the REST API

Hi all,

We do a call to the REST API. Then in the API an entity is being 
persisted to the DB. We do a flush so we can handle a possible Exception 
(like a duplicate). Although we catch this Exception and create a 
response ourselves, we receive a 500 HTML error in the return message, 
including the complete stack trace.
Is it a known issue that this error is generated including the stack trace?

The code to handle persisting to the DB:

try {
   persistIfNotAlready(X);
   // flush to DB so we can catch a possible Exception, like a duplicate key
   flushTransaction();
} catch (Exception e) {
   // handleException
}

We use Apache Isis version 1.14.

Regards,
   Leandro D'Agostino
   POCOS


Re: Persistance errors are returned through the REST API

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Could you update to the latest version (1.17.0) ... there have been a few
fixes in this area, I believe.

Thx
Dan

On Wed, 23 Jan 2019 at 14:18, Leandro D'Agostino <L....@pocos.nl>
wrote:

> Hi all,
>
> We do a call to the REST API. Then in the API an entity is being
> persisted to the DB. We do a flush so we can handle a possible Exception
> (like a duplicate). Although we catch this Exception and create a
> response ourselves, we receive a 500 HTML error in the return message,
> including the complete stack trace.
> Is it a known issue that this error is generated including the stack trace?
>
> The code to handle persisting to the DB:
>
> try {
>    persistIfNotAlready(X);
>    // flush to DB so we can catch a possible Exception, like a duplicate
> key
>    flushTransaction();
> } catch (Exception e) {
>    // handleException
> }
>
> We use Apache Isis version 1.14.
>
> Regards,
>    Leandro D'Agostino
>    POCOS
>
>