[bisq-network/bisq] Json dump for Dao state refactoring (#5608)
Stan
notifications at github.com
Wed Sep 22 17:19:42 CEST 2021
@ghubstan commented on this pull request.
> }
- public void writeToDisc(String json, String fileName) {
+ public Optional<String> read(String fileName) {
+ File jsonFile = new File(Paths.get(dir.getAbsolutePath(), fileName + ".json").toString());
+ if (!jsonFile.exists()) {
+ return Optional.empty();
+ }
+ StringBuilder json = new StringBuilder();
+ try (Scanner scanner = new Scanner(jsonFile)) {
+ while (scanner.hasNext()) {
+ json.append(scanner.next());
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
Shouldn't line 96 be `log.error("", e);` if not a thrown exception? Stack traces printed to std.err can be out of sync with the logger's buffer flushing -- it can make the timing of the stack trace in the bisq.log file a bit confusing.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5608#pullrequestreview-761066704
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210922/0206b2c4/attachment.htm>
More information about the bisq-github
mailing list