hi- i have a method that returns a string, which is derived from another method that throws an exception:
p.process() throws an exception. if I place it within a try/catch block, then val is only in scope within that try/catch block, and I cannot return it outside of the block. If i put the return inside the block, I then have to put some other default return outside the block. Seems sloppy. Is there an elegant way to do this?
p.process() throws an exception. if I place it within a try/catch block, then val is only in scope within that try/catch block, and I cannot return it outside of the block. If i put the return inside the block, I then have to put some other default return outside the block. Seems sloppy. Is there an elegant way to do this?