Skip to content

Commit

Permalink
Add try catch block to set loaded true on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
minottic committed Feb 28, 2024
1 parent 4152055 commit 29e57ed
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scilog/src/app/logbook/core/scroll-base.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ export class ScrollBaseService {
isLoadedDecorator(func: Function) {
const decorated = async (index: number, count: number, config: any) => {
this.isLoaded = false;
const data = await func(index, count, config);
this.isLoaded = true;
return data;
let data;
try {
data = await func(index, count, config);
}
catch {
console.log('scroller get data returned an error');
}
finally {
this.isLoaded = true;
return data;
}
}
return decorated;
}
Expand Down

0 comments on commit 29e57ed

Please sign in to comment.