Notifications
Announcements
No record found.
Hi ,
what should i do? i tried putting return null inside the big catch but it didn't work.
public str fcn() { System.Net.WebException webEx; System.Net.WebException webExInner; System.Exception ex; System.Exception exInner; try { //logic str webResponse = this.test(); return webResponse; } catch(webEx) { try { System.Net.HttpWebResponse webResponse = webEx.Response; switch (webResponse.StatusCode) { case 409: if(//logic) { //logic } else { error("@label" " " webEx.get_Message()); } break; default: error("@label" " " webEx.get_Message()); } } catch (webExInner) { error("label" " " webExInner.get_Message()); } catch(exInner) { error("label" " " exInner.get_Message()); } } catch (Exception::Error) { } catch(ex) { error("@label" " " ex.Message); } finally { //logic } }
Hi juniorAX,
Try returning at the end of the method. Please try this code and check if that works -
public str fcn() { System.Net.WebException webEx; System.Net.WebException webExInner; System.Exception ex; System.Exception exInner; str webResponse; try { //logic webResponse = this.test(); } catch(webEx) { try { System.Net.HttpWebResponse webResponse = webEx.Response; switch (webResponse.StatusCode) { case 409: if(//logic) { //logic } else { error("@label" " " webEx.get_Message()); } break; default: error("@label" " " webEx.get_Message()); } } catch (webExInner) { error("label" " " webExInner.get_Message()); } catch(exInner) { error("label" " " exInner.get_Message()); } } catch (Exception::Error) { } catch(ex) { error("@label" " " ex.Message); } finally { //logic } return webResponse; }
Thanks alot Gunjan
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader