snprintf(output, sizeof(output)-1, d_setOrderAuthQuery.c_str(), sqlEscape(ordername).c_str(), auth, sqlEscape(qname).c_str(), domain_id);
// cerr<<"sql: '"<<output<<"'\n";
- d_db->doCommand(output);
+ try {
+ d_db->doCommand(output);
+ }
+ catch(SSqlException &e) {
+ throw AhuException("GSQLBackend unable to update ordername/auth for domain_id "+itoa(domain_id)+": "+e.txtReason());
+ }
return true;
}
char output[1024];
snprintf(output, sizeof(output)-1, d_nullifyOrderNameQuery.c_str(), domain_id, sqlEscape(qname).c_str());
- d_db->doCommand(output);
+ try {
+ d_db->doCommand(output);
+ }
+ catch(SSqlException &e) {
+ throw AhuException("GSQLBackend unable to nullify ordername for domain_id "+itoa(domain_id)+": "+e.txtReason());
+ }
return true;
}
char output[1024];
snprintf(output, sizeof(output)-1, d_nullifyOrderNameAndAuthQuery.c_str(), sqlEscape(qname).c_str(), sqlEscape(type).c_str(), domain_id);
- d_db->doCommand(output);
+ try {
+ d_db->doCommand(output);
+ }
+ catch(SSqlException &e) {
+ throw AhuException("GSQLBackend unable to nullify ordername/auth for domain_id "+itoa(domain_id)+": "+e.txtReason());
+ }
return true;
}
snprintf(output, sizeof(output)-1, d_afterOrderQuery.c_str(), sqlEscape(lcqname).c_str(), id);
- d_db->doQuery(output);
+ try {
+ d_db->doQuery(output);
+ }
+ catch(SSqlException &e) {
+ throw AhuException("GSQLBackend unable to find before/after (after) for domain_id "+itoa(id)+": "+e.txtReason());
+ }
+
while(d_db->getRow(row)) {
after=row[0];
}
if(after.empty() && !lcqname.empty()) {
snprintf(output, sizeof(output)-1, d_firstOrderQuery.c_str(), id);
- d_db->doQuery(output);
+ try {
+ d_db->doQuery(output);
+ }
+ catch(SSqlException &e) {
+ throw AhuException("GSQLBackend unable to find before/after (first) for domain_id "+itoa(id)+": "+e.txtReason());
+ }
while(d_db->getRow(row)) {
after=row[0];
}
}
snprintf(output, sizeof(output)-1, d_beforeOrderQuery.c_str(), sqlEscape(lcqname).c_str(), id);
- d_db->doQuery(output);
+ try {
+ d_db->doQuery(output);
+ }
+ catch(SSqlException &e) {
+ throw AhuException("GSQLBackend unable to find before/after (before) for domain_id "+itoa(id)+": "+e.txtReason());
+ }
while(d_db->getRow(row)) {
before=row[0];
unhashed=row[1];
}
snprintf(output, sizeof(output)-1, d_lastOrderQuery.c_str(), id);
- d_db->doQuery(output);
+ try {
+ d_db->doQuery(output);
+ }
+ catch(SSqlException &e) {
+ throw AhuException("GSQLBackend unable to find before/after (last) for domain_id "+itoa(id)+": "+e.txtReason());
+ }
while(d_db->getRow(row)) {
before=row[0];
unhashed=row[1];
d_db->doCommand(output.c_str());
}
catch (SSqlException &e) {
- throw AhuException(e.txtReason());
+ throw AhuException("GSQLBackend unable to feed record: "+e.txtReason());
}
return true; // XXX FIXME this API should not return 'true' I think -ahu
}