Add catch handlers to client calls

Summary:
Client calls return a promise. Not dealing with the error causes promise unhandled rejection errors.

This change adds a catch block and logs the error instead.

Reviewed By: antonk52

Differential Revision: D37955029

fbshipit-source-id: 50cac5a5339961d16868ab2102d3c77790e6943c
This commit is contained in:
Lorenzo Blasa
2022-07-19 04:05:12 -07:00
committed by Facebook GitHub Bot
parent 2bb3f407b5
commit c871b221fd
2 changed files with 24 additions and 12 deletions

View File

@@ -130,7 +130,9 @@ export default class LeakCanary<PersistedState> extends FlipperPlugin<
selectedIdx: null,
selectedEid: null,
});
this.client.call('clear');
this.client.call('clear').catch((e) => {
console.warn('[LeakCanary] clear failed with error', e);
});
};
_selectElement = (leakIdx: number, eid: string) => {