You are not logged in.
Pages: 1
why it is not possible get url parameters in onError?
Ctxt.parameters is empty here
Offline
Yes exactly
Offline
there is no Uri. but there are Url = roort\CustomerService\Delete
Ctxt.Call^.InBody is unterminated json. {"cust_code"
error reurned from mysql server
Cannot delete or update a parent row: a foreign key constraint fails (`passak_utf`.`scm_sorder_cust_item`, CONSTRAINT `scm_sorder_cust_item_fk1` FOREIGN KEY (`sale_order`, `sorder_line_no`) REFERENCES `scm_sorder_det` (`sale_order`, `line_no`) ON UPDATE CASCADE)
Last edited by anouri (Yesterday 11:46:20)
Offline
All this is as intended.
But anyway, the error is to be caught with a try..finally in your own method code.
No in OnErrorUri callback.
Note: you can get the DB error from GetDbError() function of mormot.db.core.pas.
Offline
True, but I wanted to raise errors in different places in the application if possible and handle them in only one place. This way, I would avoid writing hundreds of try excepts and centralize all error handling in one place.
Offline
I am afraid it may lead to a confusion between logic error and database error.
As a better alternative, you may encapsulate the SQL execution into some methods of your own, with a centralized error handling.
Offline
I created a custom exception class containing error codes and messages for handling business errors. However, one limitation I'm facing is that I cannot access URI parameters in this scenario.
Offline
Pages: 1