Skip to content

Commit

Permalink
chore: remove all printstacktrace statementsw
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed May 3, 2023
1 parent 35a2bcf commit d408b00
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void put(String key, ObjectType objectType, Object object) {
try {
map.put(getKey(key, objectType), mapper.writeValueAsString(object));
} catch (JsonProcessingException e) {
e.printStackTrace();

throw new IllegalArgumentException();
}
}
Expand Down Expand Up @@ -67,7 +67,7 @@ private <T> T map(Class<T> type, String json) {
try {
object = mapper.readValue(json, type);
} catch (JsonProcessingException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
return object;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private String objectToJson(Object object, String type) {
try {
return mapper.writeValueAsString(object);
} catch (JsonProcessingException e) {
e.printStackTrace();

throw new IllegalArgumentException(String.format("Can not parse object of type %s", type));
}
}
Expand All @@ -79,7 +79,7 @@ private <T> T jsonToObject(ObjectEntity entity, Class<T> type) {
try {
return mapper.readValue(entity.getObject(), type);
} catch (JsonProcessingException e) {
e.printStackTrace();

throw new IllegalArgumentException(String.format("Can not parse object of type %s", type));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void saveMessage(ObjectEntity objectEntity) {
objectEntity.getType(),
objectEntity.getObject());
} catch (SQLException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
});
Expand All @@ -71,7 +71,7 @@ public ObjectEntity find(String id, String type) {
var sql = statements.getFindByIdAndTypeTemplate();
return executeQuerySingle(connection, false, this::mapObjectEntity, sql, id, type);
} catch (SQLException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
});
Expand All @@ -88,7 +88,7 @@ public List<ObjectEntity> find(String type) {
stream.close();
return result;
} catch (SQLException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
});
Expand All @@ -101,7 +101,7 @@ public void deleteMessage(String id, String type) {
var stmt = statements.getDeleteTemplate();
executeQuery(connection, stmt, id, type);
} catch (SQLException | IllegalStateException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void saveMessage(QueueMessage queueMessage) {
toJson(queueMessage.getMessage()),
queueMessage.getInvokeAfter());
} catch (SQLException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
});
Expand All @@ -82,7 +82,7 @@ public QueueMessage findById(String id) {
var sql = statements.getFindByIdTemplate();
return executeQuerySingle(connection, false, this::mapQueueMessage, sql, id);
} catch (SQLException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
});
Expand All @@ -99,7 +99,7 @@ public void deleteMessage(String id) {
var stmt = statements.getDeleteTemplate();
executeQuery(connection, stmt, id);
} catch (SQLException | IllegalStateException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
}
Expand All @@ -123,7 +123,7 @@ public void updateMessage(QueueMessage queueMessage) {
queueMessage.getInvokeAfter(),
queueMessage.getId());
} catch (SQLException | IllegalStateException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
}
Expand All @@ -146,7 +146,7 @@ public List<QueueMessage> findMessagesToSend(int max) {
stream.close();
return result;
} catch (SQLException e) {
e.printStackTrace();

throw new EdcPersistenceException(e);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void sleep(long milisec) {
try {
Thread.sleep(milisec);
} catch (InterruptedException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}

Expand Down

0 comments on commit d408b00

Please sign in to comment.