Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #13 Support JavaScript stack trace #25

Merged
merged 40 commits into from
Jul 29, 2024
Merged

Conversation

miquelbeltran
Copy link
Contributor

@miquelbeltran miquelbeltran commented Jul 22, 2024

feat: #13 Support JS Stack Trace

Description 📝

  • Purpose: Adds support to JavaScript stack traces
  • Approach:

In the ErrorDetails construction, check if the exception is of type WebIDLException, and optain the extra JavaScript stack trace information.

Then, parse this stack trace into StackTraceDetails.

Type of change

  • New feature (non-breaking change which adds functionality)

Updates

  • Updated ErrorDetails to handle JS and Dotnet exception parsing.
  • Implemented StackTraceDetails constructor for JavaScript traces.
  • Modified the html/js example code to get more interesting stack traces in JavaScript.

Screenshots 📷

Example of captured stacktrace from JavaScript:

image

image

Test plan 🧪

  • Implemented tests.
  • Checked with the Sample project.

Author to check 👓

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Reviewer to check ✔️

  • Project and all contained modules builds successfully
  • Change has been dev-/reviewer-tested, where possible
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

@miquelbeltran miquelbeltran marked this pull request as ready for review July 23, 2024 07:31
Base automatically changed from 21-remove-netcore to main July 29, 2024 04:49
Copy link
Contributor

@TheRealAgentK TheRealAgentK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now

@miquelbeltran miquelbeltran merged commit 37d4a26 into main Jul 29, 2024
3 checks passed
@miquelbeltran miquelbeltran deleted the 13-js-stacktrace branch July 29, 2024 07:16
/// Example: "causeErrors@http://localhost:5010/myfunctions.js:4:9"
/// </summary>
/// <param name="frame">JavaScript stack trace</param>
internal StackTraceDetails(string frame)
Copy link
Contributor

@robertmclaws robertmclaws Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are going to use RegEx here you should REALLY consider using .NET 8 regex attributes to leverage codegen to optimize execution.

This is the slowest way to do regex. You'll create a new RegEx instance for every line of every stack trace, which on deep stack traces will have a significant negative impact on allocations & performance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! created an issue for it #31

miquelbeltran added a commit that referenced this pull request Jul 30, 2024
…ethod

WIP attach user details

add user details to record exception async

custom IRaygunUserManager on example project

dotnet format

wip

feat: #13 Support JavaScript stack trace (#25)

* add ApiKey to appsettings.json in tests

* apply naming suggestions by Rider IDE

* inject mocked IJSRuntime

* HttpMethod should be String not type HttpMethod

* wip fixing tests

* simple fix

* fix tests

* cleanup

* cleanup

* test cleanup

* more cleanup

* restore file

* ci: dotnet formatting

* simplify job

* test break formatting

* fix format

* dotnet format

* fixing warnings

* fix warnings

* 5 warnings

* ci: Code formatting (#7)

* ci: dotnet formatting

* simplify job

* test break formatting

* fix format

* dotnet format

* fix acronym formatting

* dotnet format

* refactor: remove .NetCore from Raygun.NetCore.Blazor

* WIP

* fix visibility after refactor

* more refactor

* WIP

* implement basic JS stacktrace parsing

* implement tests

* cleanup

* remove TODOs

* remove console log

* fix merge errors

* remove console.writeline

oops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raygun.NetCore.Blazor: Stack Trace data from JS exceptions
3 participants