I want to save all the errors in the database. The problem occurs when an EOracleError error occurs, because then there is no information in the message about the error string or about the error.
To catch errors, I use the TApplicationEvents component:
procedure TfrmMain.ApplicationEvents1Exception(Sender: TObject; E: Exception); begin dmMain.oqLog.SetVariable(':V_ERROR', e.ToString); dmMain.oqLog.Execute; end; For the test, I cause an error no_data_found by executing the query:
begin raise no_data_found; end; As a result, in e.ToString I have: ORA-01403: no data found ORA-06512: at line 2 . The string e.StackTrace is generally empty.
How to get the name of the dataset, the forms and lines in which the error occurred?