} catch (JsonMappingException e) { String message = e.getCause() != null ? e.getCause().getMessage() : e.getMessage(); returnError(request, "JSON couldn't parsed: " + message, BAD_REQUEST); return; } catch (IOException e) { returnError(request, "JSON couldn't parsed: " + e.getMessage(), BAD_REQUEST); return; } catch (RakamException e) { LogUtil.logException(request, e); returnError(request, e.getMessage(), e.getStatusCode()); return; } catch (HttpRequestException e) { returnError(request, e.getMessage(), e.getStatusCode()); return; } catch (IllegalArgumentException e) { LogUtil.logException(request, e); returnError(request, e.getMessage(), BAD_REQUEST); return; } catch (Exception e) { LOGGER.error(e, "Error while collecting event"); returnError(request, "An error occurred", INTERNAL_SERVER_ERROR); return; if (ex instanceof RakamException) { LogUtil.logException(request, ex); returnError(request, ex.getMessage(), ((RakamException) ex).getStatusCode()); } else { LOGGER.error(ex, "Error while collecting event");
} catch (RakamException e) { LogUtil.logException(request, e); EventCollectionHttpService.returnError(request, e.getMessage(), e.getStatusCode()); } catch (HttpRequestException e) { EventCollectionHttpService.returnError(request, e.getMessage(), e.getStatusCode()); } catch (Throwable t) { LOGGER.error(t); EventCollectionHttpService.returnError(request, "An error occurred", INTERNAL_SERVER_ERROR);
returnError(request, "JSON couldn't parsed: " + e.getOriginalMessage(), BAD_REQUEST); return; } catch (IOException e) { returnError(request, "JSON couldn't parsed: " + e.getMessage(), BAD_REQUEST); return; } catch (RakamException e) { LogUtil.logException(request, e); returnError(request, e.getMessage(), e.getStatusCode()); return; } catch (HttpRequestException e) { returnError(request, e.getMessage(), e.getStatusCode()); return; } catch (IllegalArgumentException e) { LogUtil.logException(request, e); returnError(request, e.getMessage(), BAD_REQUEST); return; } catch (Throwable e) { LOGGER.error(e, "Error while collecting event"); returnError(request, "An error occurred", INTERNAL_SERVER_ERROR); return; if (storeEx instanceof RakamException) { LogUtil.logException(request, storeEx); returnError(request, storeEx.getMessage(), ((RakamException) storeEx).getStatusCode()); } else { LOGGER.error(storeEx, "Error while collecting events"); returnError(request, "An error occurred", INTERNAL_SERVER_ERROR);