Created
November 23, 2024 13:58
-
-
Save javierguerrero/da8c304fa2bcac3e29e3c7f3614223a9 to your computer and use it in GitHub Desktop.
exception_handling_csharp_chapter7_1.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
// Código que puede fallar | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine($"Mensaje: {ex.Message}"); | |
Console.WriteLine($"Traza de pila: {ex.StackTrace}"); | |
if (ex.InnerException != null) | |
{ | |
Console.WriteLine($"Excepción interna: {ex.InnerException.Message}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment