Catch Seed class construction errors

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Sebastian Martinez
2022-02-07 11:35:54 +01:00
committed by Alexis Sellier
parent 75ccac422e
commit 0263a5f032
9 changed files with 69 additions and 40 deletions
+4 -2
View File
@@ -41,13 +41,15 @@
}).then(async (result) => {
const profile = result?.profile;
const seedInstance = profile?.seed ?? result?.seed;
const cfg = seedInstance ? config.withSeed(seedInstance) : config;
const cfg = seedInstance && seedInstance.valid ? config.withSeed(seedInstance) : config;
const info = await proj.getInfo(urn, cfg);
projectInfo = info;
const anchors = await getAllAnchors(config, urn, profile?.anchorsAccount ?? org);
let branches = Array([info.meta.defaultBranch, info.head]) as [string, string][];
let peers: proj.Peer[] = [];
projectInfo = info;
// Checks for delegates returned from seed node, as feature check of the seed node
if (info.meta.delegates) {
// Check for selected peer to override available branches.
+1 -1
View File
@@ -30,7 +30,7 @@
state = { status: Status.Loaded };
info = result;
} catch (err: any) {
console.error(err.message);
console.debug(err);
state = { status: Status.Error, error: err.message };
}
});