Hi there,
To me it's a bit unclear in which case I should use Connection_getLastError(). And, when using Exception_frame.message, if it makes sense to catch a specific exception.
What I mean is:
TRY {
Connection_executeQuery(...);
}
CATCH (SQLException) {
printf("SQLException -- %sn", Connection_getLastError(c));
}
versus
TRY {
Connection_executeQuery(...);
}
CATCH (SQLException) {
printf("SQLException -- %sn", Exception_frame.message);
}
versus
TRY {
Connection_executeQuery(...);
}
ELSE {
printf("Exception -- %sn", Exception_frame.message);
}
Ok, I understand that ELSE { } will catch every exception, so I can't safely use Connection_getLastError() there.
But with CATCH(SQLException), is there a situation where Connection_getLastError() is preferred over Exception_frame.message?
Cheers,
Till