Don't leave rejection unhandled if node fetching fails

Summary: Fix potentially unhandled promise rejection in Layout inspector. Not really reproducible, and probably originating from old Flipper versions (no trace is available either), since we have a lot of connection check in place. Just in case still handled the exception, for example if something goes wrong on client side

Reviewed By: passy

Differential Revision: D31267465

fbshipit-source-id: d1b384db7bb010af8d2aa12ae29110f343fb14af
This commit is contained in:
Michel Weststrate
2021-09-30 01:32:53 -07:00
committed by Facebook GitHub Bot
parent 8fd012a8a3
commit b8236f1b3a
2 changed files with 12 additions and 3 deletions

View File

@@ -110,7 +110,12 @@ export default class LayoutPlugin extends FlipperPlugin<
callClient,
'getNodes',
supportsMethod,
);
).catch((e) => {
console.error(
`[Layout] Failed to fetch Nodes from app while creating export`,
e,
);
});
}
const AXelements: ElementMap = {};
if (rootAXElement) {