Skip to content

Instantly share code, notes, and snippets.

View michaelviveiros's full-sized avatar
writing...

Michael Viveiros michaelviveiros

writing...
View GitHub Profile
@michaelviveiros
michaelviveiros / ObterNumeroLinhaExceptionCSharp.cs
Created January 28, 2024 01:37
Obter o número da linha durante a exceção
try
{
//Seu código
}
catch (Exception ex)
{
//Obtém o rastreamento da exceção com as informações do arquivo de origem.
var st = new StackTrace(ex, true);
//Obtenha o quadro da pilha superior.
@michaelviveiros
michaelviveiros / GetLineNumberDuringErrorException.cs
Last active January 28, 2024 01:38
GetLineNumberDuringErrorException
try
{
//Your Code
}
catch (Exception ex)
{
// Get stack trace for the exception with source file information
var st = new StackTrace(ex, true);
// Get the top stack frame