Here's a question where my real world programming inexperience shines through. I have a function which makes a call to three other functions:
Public Sub StartService()
RunSearch()
SaveMessages()
DeleteMessages()
End Sub
within each of the methods RunSearch(), SaveMessages() and DeleteMessages()
I am using Try Catch statements to catch errors. Right now I catch the error and write to an error log when RunSearch()
errors out, but I'm also get two errors from SaveMessages()
and DeleteMessages()
because these functions are dependent upon RunSearch()
not returning an error. I am trying to build good a error catching foundation so I don't just want to kill the app when there's an error. My question is this: How can I gracefully stop execution if an error occurs in RunSearch()
.