| List: | MySQL++ | « Previous MessageNext Message » | |
| From: | Warren Young | Date: | February 28 2008 9:16pm |
| Subject: | Re: Strange behavior of connect() when specifying a different port | ||
| View as plain text | |||
António Santos wrote:
> perror("Connection::connect");
By the way, this isn't the best way to handle MySQL++ errors. In this
instance, what perror appends to your string will only be correct if the
connection failure is due to an error return from a system call. If
something else goes wrong, such as the server rejecting your login
parameters, it will tell you something like "no error" because the last
system call to run probably succeeded.
Far better is to either a) enable exceptions, getting the error message
from the exception object; or b) call either Query::error() or
Connection::error() (same thing) to get the error message.
| Thread | ||
|---|---|---|
| • Strange behavior of connect() when specifying a different port | António Santos | 27 Feb |
| • Re: Strange behavior of connect() when specifying a different port | Warren Young | 28 Feb |
| • Re: Strange behavior of connect() when specifying a different port | William F. Dowling | 29 Feb |
| • Re: Strange behavior of connect() when specifying a different port | António Santos | 28 Feb |
| • Re: Strange behavior of connect() when specifying a different port | Warren Young | 28 Feb |
| • Re: Strange behavior of connect() when specifying a different port | Warren Young | 28 Feb |
| • Re: Strange behavior of connect() when specifying a different port | António Santos | 29 Feb |
| • Re: Strange behavior of connect() when specifying a different port | Warren Young | 29 Feb |
| • Re: Strange behavior of connect() when specifying a different port | António Santos | 6 Mar |
| • Re: Strange behavior of connect() when specifying a different port | Warren Young | 7 Mar |
