MysorePak Posted May 7, 2015 Report Posted May 7, 2015 bhayya eppudu nenu okka document generate chesthunanu using one of the API, so adhi fail ayithey use other code to generate document okka table lo okka flage chesa initial value is true with api generation ani , then created a variable assigned the value from db resultset.. apidoc = resultset value(true) if(apidoc){ API code but if unable to generate or exception catch chesthey then how i can change that variable "apidoc" value to false and go with other non api code } question is how i can set variable value in catch block
kiran karthik Posted May 7, 2015 Report Posted May 7, 2015 if my understaning is correct, you can wrap your code into try {} catch{} snippet: boolean apidoc = false; try{ apidoc=resultset value(true) if(apidoc){ }catch{ apidoc =false; /*Now call your another api code*/ }
fake_Bezawada Posted May 7, 2015 Report Posted May 7, 2015 Catch block e.pruntStackTrace ki mundu false ki set chey variable ni
MysorePak Posted May 7, 2015 Author Report Posted May 7, 2015 Bhayya eppudu a variable set chesamu then exception catch chesaka it will not exceute other programe right Catch block e.pruntStackTrace ki mundu false ki set chey variable ni
MysorePak Posted May 7, 2015 Author Report Posted May 7, 2015 apidoc= false set ayyina taruvatha will exceute remaining code aa? if my understaning is correct, you can wrap your code into try {} catch{} snippet: boolean apidoc = false; try{ apidoc=resultset value(true) if(apidoc){ }catch{ apidoc =false; /*Now call your another api code*/ }
gunturodu1 Posted May 8, 2015 Report Posted May 8, 2015 apidoc= false set ayyina taruvatha will exceute remaining code aa? Yes it will execute the remaining code.. In stead of writing the whole code in catch block.. wrap that else code in a method and call that method in catch block.
Recommended Posts