Skip to content

Commit

Permalink
Improved error handling in Worker
Browse files Browse the repository at this point in the history
  • Loading branch information
UO281801 committed May 9, 2023
1 parent c60f21a commit 6cce3e9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions restapi/src/repositories/pararelism/Worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ export class Worker {
}

public async run(): Promise<void> {
let session = await getSessionFromStorage(this.sessionId);
let dataset = createSolidDataset();

if (session == null) {
throw new Error("The user must be logged in.");
}
try{
let session = await getSessionFromStorage(this.sessionId);

let dataset = createSolidDataset();
if (session == null) {
throw new Error("The user must be logged in.");
}
try {
dataset = await getSolidDataset(this.resource, {
fetch: session.fetch,
});
} catch (e) {}
}catch(e){}

try {
dataset = await getSolidDataset(this.resource, {
fetch: session.fetch,
});
} catch (e) {}

this.result = dataset;
}
Expand Down

0 comments on commit 6cce3e9

Please sign in to comment.