Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@ export class TimeEntriesTableComponent implements OnInit, OnDestroy, AfterViewIn
private rerenderDataTable(): void {
if (this.dtElement && this.dtElement.dtInstance) {
this.dtElement.dtInstance.then((dtInstance: DataTables.Api) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is not a correct way to implement a try catch, you can use the if / else or else try / catch but not the two together.

I am attaching a link with information on the correct use of a try / catch.
https://javascript.plainenglish.io/the-dark-side-of-typescript-try-catch-deeded18ba0d

dtInstance.destroy();
this.dtTrigger.next();
try {
dtInstance.destroy();
this.dtTrigger.next();
} catch (error) {}
});
} else {
this.dtTrigger.next();
try {
this.dtTrigger.next();
} catch (error) {}
}
}

Expand Down