diff --git a/source/mysql/connection.d b/source/mysql/connection.d index cfc4f36c..e940ac08 100644 --- a/source/mysql/connection.d +++ b/source/mysql/connection.d @@ -275,6 +275,12 @@ package: ubyte[] packet = getPacket(); + if (packet.length > 0 && packet[0] == ResultPacketMarker.error) + { + auto okp = OKErrorPacket(packet); + enforceEx!MYX(!okp.error, "Connection failure: " ~ cast(string) okp.message); + } + _protocol = packet.consume!ubyte(); _serverVersion = packet.consume!string(packet.countUntil(0));