The big difference is that try...catch
will swallow the exception, hiding the fact that an error occurred. try..finally
will run your cleanup code and then the exception will keep going, to be handled by something that knows what to do with it.
More Related Contents:
- Will code in a Finally statement fire if I return a value in a Try block?
- When to use try/catch blocks?
- Try-Catch-Finally c# in Console [closed]
- Is there a difference between “throw” and “throw ex”?
- WPF global exception handler [duplicate]
- Best practices for catching and re-throwing .NET exceptions
- Why catch and rethrow an exception in C#?
- How using try catch for exception handling is best practice
- .NET Global exception handler in console application
- .NET – What’s the best way to implement a “catch all exceptions handler”
- Main method code entirely inside try/catch: Is it bad practice?
- What’s the difference between Application.ThreadException and AppDomain.CurrentDomain.UnhandledException?
- What is the real overhead of try/catch in C#?
- What happens if a finally block throws an exception?
- Handling exceptions, is this a good way?
- The calling thread cannot access this object because a different thread owns it [duplicate]
- How can I catch a 404?
- Try-catch speeding up my code?
- Wrong line number on stack trace
- How to catch ALL exceptions/crashes in a .NET app [duplicate]
- How to check if IOException is Not-Enough-Disk-Space-Exception type?
- Is this a bad practice to catch a non-specific exception such as System.Exception? Why?
- What is ApplicationException for in .NET?
- Show line number in exception handling
- What really happens in a try { return x; } finally { x = null; } statement?
- How to log all thrown exceptions?
- Is it bad practice to return from within a try catch finally block?
- How do I create 7-Zip archives with .NET?
- Regarding usage of Task.Start() , Task.Run() and Task.Factory.StartNew()
- How do I get the Local Network IP address of a computer programmatically?