| List: | MySQL++ | « Previous MessageNext Message » | |
| From: | Warren Young | Date: | January 7 2010 10:06pm |
| Subject: | Re: Query::execute crashes without a connected driver | ||
| View as plain text | |||
On 1/7/2010 6:15 AM, Joel Fielder wrote: > > This may be expected behaviour, but if throw_exceptions is true it still > crashes where I'd expect an exception. Would you agree? Reasonable. > I wasn't sure of what should happen to > copacetic_ flag It should probably be set to false. Else, this doesn't work right: Connection c(false); // no exceptions Query q = c.query("select foo from bar bla bla bla"); SimpleResult r = q.execute(); if (q) { // it gets here } else { // not here like you might expect } > which exception would be most appropriate to throw! If you want to use an existing one, I like ConnectionFailed. If you feel that's misleading, you can define a new one. I'm not shy about adding exception types when warranted. > I've also made it return SimpleResult() if not connected but maybe you > still want it to break? No, you followed the existing pattern later in the routine. I don't want to apply this as-is even with the suggested changes, though, because it probably affects much more than just execute(); exec(), store*(), use()... Maybe even high-level methods like insertfrom().
| Thread | ||
|---|---|---|
| • Query::execute crashes without a connected driver | Joel Fielder | 7 Jan |
| • Re: Query::execute crashes without a connected driver | Warren Young | 7 Jan |
| • Re: Query::execute crashes without a connected driver | Joel Fielder | 8 Jan |
| • mysqlpp::ScopedConnection | Joel Fielder | 8 Jan |
| • Re: mysqlpp::ScopedConnection | Warren Young | 9 Jan |
| • Re: mysqlpp::ScopedConnection | Jonathan Wakely | 9 Jan |
| • Re: mysqlpp::ScopedConnection | Joel Fielder | 11 Jan |
| • Re: mysqlpp::ScopedConnection | Jonathan Wakely | 11 Jan |
| • Re: mysqlpp::ScopedConnection | Warren Young | 11 Jan |
| • Re: mysqlpp::ScopedConnection | Jonathan Wakely | 11 Jan |
| • Re: Query::execute crashes without a connected driver | Joel Fielder | 13 Jan |
| • Re: Query::execute crashes without a connected driver | Warren Young | 13 Jan |
| • Re: mysqlpp::ScopedConnection | Joel Fielder | 11 Jan |
| • Re: mysqlpp::ScopedConnection | Warren Young | 11 Jan |
| • Re: mysqlpp::ScopedConnection | Joel Fielder | 11 Jan |
| • Re: mysqlpp::ScopedConnection | Warren Young | 11 Jan |
| • Re: mysqlpp::ScopedConnection | Joel Fielder | 12 Jan |
