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:
committed by
Facebook GitHub Bot
parent
c158177ea6
commit
77905f30c8
@@ -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}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user