Skip to content

Commit 0fb75ed

Browse files
committed
emit error to connection instead of throwing
1 parent 23d8fff commit 0fb75ed

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/commands/auth_switch.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ function authSwitchRequest(packet, connection, command) {
4343
authPlugin = standardAuthPlugins[pluginName];
4444
}
4545
if (!authPlugin) {
46-
throw new Error(
47-
`Server requests authentication using unknown plugin ${pluginName}. See ${'TODO: add plugins doco here'} on how to configure or author authentication plugins.`
46+
const err = new Error(
47+
`Server requests authentication using unknown plugin ${pluginName}.`
4848
);
49+
connection.emit('error', err);
50+
return;
4951
}
5052
connection._authPlugin = authPlugin({ connection, command });
5153
Promise.resolve(connection._authPlugin(pluginData)).then(data => {

0 commit comments

Comments
 (0)