Skip to content

Commit

Permalink
added support for Spanish stack traces
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsharE committed Jan 8, 2025
1 parent 9c9dfff commit c839dd6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
A simple and easy JavaScript library for highlighting .NET stack traces

#### Stacktrace - Language support
[![English](images/flags/US%20-%20United%20States.svg)](#) [![Danish](images/flags/DK%20-%20Denmark.svg)](#) [![German](images/flags/DE%20-%20Germany.svg)](#) [![Russian](images/flags/RU%20-%20Russian%20Federation.svg)](#) [![Chinese](images/flags/CN%20-%20China.svg)](#)
[![English](images/flags/US%20-%20United%20States.svg)](#) [![Danish](images/flags/DK%20-%20Denmark.svg)](#) [![German](images/flags/DE%20-%20Germany.svg)](#) [![Spanish](images/flags/ES%20-%20Spain.svg)](#) [![Russian](images/flags/RU%20-%20Russian%20Federation.svg)](#) [![Chinese](images/flags/CN%20-%20China.svg)](#)

#### Demo
[![netStack.js - demo](images/example.jpg)](https://elmah.io/tools/stack-trace-formatter/)
Expand Down
2 changes: 2 additions & 0 deletions netstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
{ name: 'english', at: 'at', in: 'in', line: 'line' },
{ name: 'danish', at: 'ved', in: 'i', line: 'linje' },
{ name: 'german', at: 'bei', in: 'in', line: 'Zeile' },
{ name: 'spanish', at: 'en', in: 'en', line: 'línea' },
{ name: 'russian', at: 'в', in: 'в', line: 'строка' },
{ name: 'chinese', at: '在', in: '位置', line: '行号' }
];
Expand Down Expand Up @@ -130,6 +131,7 @@
english: /\s+at .*\)/,
danish: /\s+ved .*\)/,
german: /\s+bei .*\)/,
spanish: /\s+en .*\)/,
russian: /\s+в .*\)/,
chinese: /\s+ .*\)/
};
Expand Down
1 change: 1 addition & 0 deletions test/stacktraces.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<pre><code class="stacktrace-en-2">Elmah.TestException: This is a test exception that can be safely ignored. at Elmah.ErrorLogPageFactory.FindHandler(String name) in C:\ELMAH\src\Elmah\ErrorLogPageFactory.cs:line 126 at Elmah.ErrorLogPageFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) in C:\ELMAH\src\Elmah\ErrorLogPageFactory.cs:line 66 at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)</code></pre>
<pre><code class="stacktrace-dk">System.ApplicationException: Kørselsfejl ---> System.FormatException: Inputstrengen blev ikke formateret korrekt. ved System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) ved System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info) ved System.Int32.Parse(String s) ved MyNamespace.IntParser.Execute(String s) i C:\apps\MyNamespace\IntParser.cs:linje 13 --- Slutning af stackspor fra tidligere sted, hvor undtagelse blev kastet --- ved Elmah.Io.App.Controllers.AccountController.ChangeEmail(String secret) i x:\agent\_work\94\s\src\Elmah.Io.App\Controllers\AccountController.cs:linje 45 ved System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) --- Slutning af stackspor fra tidligere sted, hvor undtagelse blev kastet --- ved MyNamespace.IntParser.Execute(String s) i C:\apps\MyNamespace\IntParser.cs:linje 17 ved MyNamespace.Program.Main(String[] args) i C:\apps\MyNamespace\Program.cs:linje 13</code></pre>
<pre><code class="stacktrace-de">System.ApplicationException: Etwas hier ---> System.FormatException: Die Eingabezeichenfolge wurde nicht richtig formatiert. bei System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) bei System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info) bei System.Int32.Parse(String s) bei MyNamespace.IntParser.Execute(String s) in C:\apps\MyNamespace\IntParser.cs:Zeile 13 --- Ende des Stack-Trace vom vorherigen Ort, an dem eine Ausnahme ausgelöst wurde --- bei Elmah.Io.App.Controllers.AccountController.ChangeEmail(String secret) in x:\agent\_work\94\s\src\Elmah.Io.App\Controllers\AccountController.cs:Zeile 45 bei System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) --- Ende des Stack-Trace vom vorherigen Ort, an dem eine Ausnahme ausgelöst wurde --- bei MyNamespace.IntParser.Execute(String s) in C:\apps\MyNamespace\IntParser.cs:Zeile 17 bei MyNamespace.Program.Main(String[] args) in C:\apps\MyNamespace\Program.cs:Zeile 13</code></pre>
<pre><code class="stacktrace-es">System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) en Grpc.Net.Client.Internal.GrpcCall`2.&lt;GetResponseHeadersCoreAsync&gt;d__72.MoveNext() en System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) en System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) en Grpc.Net.Client.Internal.HttpClientCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method`2 method, String host, CallOptions options, TRequest request) en Grpc.Core.Interceptors.InterceptingCallInvoker.&lt;BlockingUnaryCall&gt;b__3_0[TRequest,TResponse](TRequest req, ClientInterceptorContext`2 ctx) en Grpc.Core.ClientBase.ClientBaseConfiguration.ClientBaseConfigurationInterceptor.BlockingUnaryCall[TRequest,TResponse](TRequest request, ClientInterceptorContext`2 context, BlockingUnaryCallContinuation`2 continuation) en Grpc.Core.Interceptors.InterceptingCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method`2 method, String host, CallOptions options, TRequest request) en WinForm_gRPC.Test.TestClient.Communication(MyRequest request, CallOptions options) en C:\Users\2590\source\repos\WinForm_gRPC\WinForm_gRPC\obj\Debug\Protos\TestGrpc.cs:línea 114 en WinForm_gRPC.Test.TestClient.Communication(MyRequest request, Metadata headers, Nullable`1 deadline, CancellationToken cancellationToken) en C:\Users\2590\source\repos\WinForm_gRPC\WinForm_gRPC\obj\Debug\Protos\TestGrpc.cs:línea 109 en WinForm_gRPC.Form1.btnLogin_Click(Object sender, EventArgs e) en C:\Users\2590\source\repos\WinForm_gRPC\WinForm_gRPC\Form1.cs:línea 135</code></pre>
<pre><code class="stacktrace-ru">System.ApplicationException: Ошибка в ходе выполнения ---> System.FormatException: Входная строка имела неверный формат. в System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) в System.Number.ParseInt32(ReadOnlySpan`1 value, NumberStyles styles, NumberFormatInfo info) в System.Int32.Parse(String s) в MyNamespace.IntParser.Execute(String s) в C:\apps\MyNamespace\IntParser.cs:строка 13 --- Конец трассировка стека из предыдущего расположения, где возникло исключение --- в Elmah.Io.App.Controllers.AccountController.ChangeEmail(String secret) в x:\agent\_work\94\s\src\Elmah.Io.App\Controllers\AccountController.cs:строка 45 в System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) --- End of stack trace from previous location where exception was thrown --- в MyNamespace.IntParser.Execute(String s) в C:\apps\MyNamespace\IntParser.cs:строка 17 в MyNamespace.Program.Main(String[] args) в C:\apps\MyNamespace\Program.cs:строка 13</code></pre>
<pre><code class="stacktrace-cn">System.Exception: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 系统找不到指定的文件。 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 ClrCustomVisualizerVSHost.VisualizerTargetInternal.&lt;RequestDataAsync&gt;d__10.MoveNext() --- 引发异常的上一位置中堆栈跟踪的末尾 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 在 Microsoft.VisualStudio.OutOfProcessVisualizers.VisualizerTarget.&lt;RequestDataAsync&gt;d__10.MoveNext()</code></pre>

Expand Down
15 changes: 15 additions & 0 deletions test/test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c839dd6

Please sign in to comment.