Improved exception throwing
This commit is contained in:
parent
67006b8f67
commit
f8e6a0cc43
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.gcat.rest;
|
package org.gcube.gcat.rest;
|
||||||
|
|
||||||
import javax.ws.rs.InternalServerErrorException;
|
import javax.ws.rs.InternalServerErrorException;
|
||||||
|
import javax.ws.rs.WebApplicationException;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.Response.ResponseBuilder;
|
import javax.ws.rs.core.Response.ResponseBuilder;
|
||||||
import javax.ws.rs.core.Response.Status;
|
import javax.ws.rs.core.Response.Status;
|
||||||
|
@ -29,8 +30,10 @@ public class REST<C extends CKAN> extends BaseREST implements CRUD<Response,Resp
|
||||||
C ckan = reference.newInstance();
|
C ckan = reference.newInstance();
|
||||||
ckan.setUriInfo(uriInfo);
|
ckan.setUriInfo(uriInfo);
|
||||||
return ckan;
|
return ckan;
|
||||||
|
} catch (WebApplicationException e) {
|
||||||
|
throw e;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
throw new InternalServerErrorException();
|
throw new InternalServerErrorException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue