Please help me how to catch exception if i call service from mvc controller? if i do that my code never enter catch section in Application service but if i call sevice from java script directly all thing is ok, all my need is to not call service from javascript to catch exception
this code from View
and this from controller
and this from service
7 Answer(s)
-
0
What exception?
-
0
in last statement before try block , number 2 is wrong to try entring in catch, it is foreign key reference
so i provide the Id not exist in database -
0
And you're saying DB inserts non-existing foreign key when called from controller?
-
0
no, it is not insert and not enter the catch for this error
-
0
Then what happens?
-
0
nothing
all i need to let my code to enter to catch bloack and set error message to be shown to user -
0
i solve it
thank you