U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » question about overriding SqlError
question about overriding SqlError [message #38970] Fri, 01 February 2013 14:59 Go to previous message
Peter is currently offline  Peter
Messages: 16
Registered: October 2012
Promising Member
Hi.

I wanted to override SkylarkApp::SqlError method so that I can handle SQL errors the way I like. My first attempt was something like this:

void ChairSupervisor::SqlError(Http& http, const SqlExc& e)
{
   http << "<html><body>SQL error</body</html>";
}


Then I executed exception-throwing SQL query to check if my method works as intended. As a result I expected to see a blank page with "SQL error" text on it. Instead, the whole DB error message appeared on the screen with my message appended to it.
This is not what I want. Is there any way to get rid of the original DB error message and just display my own error message instead?

In Http::Dispatch the following code is responsible for current behaviour:

response << "Internal server error<br>"
         << "SQL ERROR: " << e;

app.SqlError(*this, e);


So, basically, SQL error message from e (SQL exception object) is always displayed and my own message is later appended to it. Can I do anything to change this if I don't want to modify library code myself?
 
Read Message
Read Message
Previous Topic: Something wrong with post_identity()?
Next Topic: Skylark and Date/Time format
Goto Forum:
  


Current Time: Thu Oct 01 12:22:08 GMT+2 2026

Total time taken to generate the page: 0.15527 seconds