Commit ae971994 authored by till's avatar till

Enhancement: restructured code - to loop 'earlier'

 * push error handling down to when it occurs
 * WIP, as I am unable to trigger false currently
parent 2515da36
......@@ -186,11 +186,17 @@ class MysqliConnection implements Connection
);
}
if (!mysqli_options($this->_conn, $option, $value)) {
if (@mysqli_options($this->_conn, $option, $value)) {
continue;
}
$msg = sprintf($exceptionMsg, 'Failed to set', $option, $value);
$msg .= sprintf(', error: %s (%d)', mysqli_error($this->_conn), mysqli_errno($this->_conn));
throw new MysqliException(
sprintf($exceptionMsg, 'Failed to set', $option, $value)
$msg,
mysqli_errno($this->_conn)
);
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment