Skip to content

Commit

Permalink
The server going away may cause it to send an error packet
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi authored Oct 15, 2017
1 parent 0204d14 commit 9306cbe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,12 @@ private function handleError($packet) {
$this->parseCallback = null;
if ($this->connectionState == self::READY) {
// normal error
if ($this->config->exceptions) {
$this->getDeferred()->fail(new QueryException("MySQL error ({$this->connInfo->errorCode}): {$this->connInfo->errorState} {$this->connInfo->errorMsg}", $this->query));
} else {
$this->getDeferred()->resolve(false);
if ($deferred = $this->getDeferred()) {
if ($this->config->exceptions) {
$deferred->fail(new QueryException("MySQL error ({$this->connInfo->errorCode}): {$this->connInfo->errorState} {$this->connInfo->errorMsg}", $this->query));
} else {
$deferred->resolve(false);
}
}
$this->query = null;
$this->ready();
Expand Down

0 comments on commit 9306cbe

Please sign in to comment.