Skip to content

Commit c2fe7db

Browse files
authored
Wrap executePacket.toPacket(1) call with try/catch
This is to provide more context to error messages when a parameter is undefined.
1 parent 5f65614 commit c2fe7db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/commands/execute.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ Execute.prototype.start = function(packet, connection) {
5050
this.parameters,
5151
connection.config.charsetNumber
5252
);
53-
connection.writePacket(executePacket.toPacket(1));
53+
try {
54+
connection.writePacket(executePacket.toPacket(1));
55+
} catch (error) {
56+
this.onResult(error)
57+
}
5458
return Execute.prototype.resultsetHeader;
5559
};
5660

0 commit comments

Comments
 (0)