mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-01 09:40:35 +13:00
Make insights generation more robust
This commit is contained in:
parent
d0d8e96e5d
commit
722d239fda
1 changed files with 8 additions and 2 deletions
|
@ -8,6 +8,7 @@ import io.xpipe.app.comp.store.StoreSectionComp;
|
|||
import io.xpipe.app.core.AppI18n;
|
||||
import io.xpipe.app.core.AppImages;
|
||||
import io.xpipe.app.fxcomps.Comp;
|
||||
import io.xpipe.app.issue.ErrorEvent;
|
||||
import io.xpipe.app.storage.DataStorage;
|
||||
import io.xpipe.app.storage.DataStoreEntry;
|
||||
import io.xpipe.core.dialog.Dialog;
|
||||
|
@ -85,12 +86,17 @@ public interface DataStoreProvider {
|
|||
return null;
|
||||
}
|
||||
|
||||
return "## Insights\n\n" + createInsightsMarkdown(store.getValue());
|
||||
try {
|
||||
return "## Insights\n\n" + createInsightsMarkdown(store.getValue());
|
||||
} catch (Exception ex) {
|
||||
ErrorEvent.fromThrowable(ex).handle();
|
||||
return "?";
|
||||
}
|
||||
},
|
||||
store);
|
||||
return new MarkdownComp(content, s -> s)
|
||||
.apply(struc -> struc.get().setPrefWidth(450))
|
||||
.apply(struc -> struc.get().setPrefHeight(200));
|
||||
.apply(struc -> struc.get().setPrefHeight(250));
|
||||
}
|
||||
|
||||
default String createInsightsMarkdown(DataStore store) {
|
||||
|
|
Loading…
Reference in a new issue