Add context to AbstractClient rawCall errors

Summary: Attempting to fix T146503217. There is no context to the error so this should make it easier in the future. In the MID it says that the layout plugin was selected i made sure to handle any promise rejections in that plugin

Reviewed By: passy

Differential Revision: D44302939

fbshipit-source-id: 987e2c4efd2dc47d2e032d1b21f90458ec5a2df5
This commit is contained in:
Luke De Feo
2023-03-24 04:28:58 -07:00
committed by Facebook GitHub Bot
parent c158177ea6
commit 77905f30c8
2 changed files with 8 additions and 3 deletions

View File

@@ -357,6 +357,9 @@ export default abstract class AbstractClient extends EventEmitter {
const plugin = params ? params.api : undefined;
const baseErrorMessage = `Unable to send ${params?.method ?? method} to ${
params?.api ?? 'FlipperCore'
}`;
console.debug(data, 'message:call');
const mark = this.getPerformanceMark(metadata);
@@ -391,12 +394,12 @@ export default abstract class AbstractClient extends EventEmitter {
});
}
} catch (error) {
reject(new Error('Unable to send, connection error: ' + error));
reject(new Error(`${baseErrorMessage}, connection error: ${error}`));
}
} else {
reject(
new Error(
`Cannot send ${method}, client is not accepting messages for plugin ${plugin}`,
`${baseErrorMessage}, client is not accepting messages for plugin ${plugin}`,
),
);
}