Skip to content

Commit

Permalink
fix(Faro): Exception context got lost while transforming Faro excepti…
Browse files Browse the repository at this point in the history
…ons. (#1413)

Co-authored-by: Paschalis Tsilias <tpaschalis@users.noreply.github.com>
  • Loading branch information
codecapitano and tpaschalis authored Aug 8, 2024
1 parent 69f7c9a commit 41a8310
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ internal API changes are not present.
Main (unreleased)
-----------------

### Bugfixes

- Fixed an issue which caused loss of context data in Faro exception. (@codecapitano)

v1.3.0
-----------------

Expand Down
1 change: 1 addition & 0 deletions internal/component/faro/receiver/sourcemaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ func transformException(log log.Logger, store sourceMapsStore, ex *payload.Excep
Value: ex.Value,
Stacktrace: &payload.Stacktrace{Frames: frames},
Timestamp: ex.Timestamp,
Context: ex.Context,
}
}

Expand Down
3 changes: 3 additions & 0 deletions internal/component/faro/receiver/sourcemaps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func Test_sourceMapsStoreImpl_ReadFromFileSystem(t *testing.T) {
},
},
},
Context: payload.ExceptionContext{"ReactError": "Annoying Error", "component": "ReactErrorBoundary"},
}

actual := transformException(logger, store, &payload.Exception{
Expand Down Expand Up @@ -262,9 +263,11 @@ func Test_sourceMapsStoreImpl_ReadFromFileSystem(t *testing.T) {
},
},
},
Context: payload.ExceptionContext{"ReactError": "Annoying Error", "component": "ReactErrorBoundary"},
}, "123")

require.Equal(t, expect, actual)
require.EqualValues(t, payload.ExceptionContext{"ReactError": "Annoying Error", "component": "ReactErrorBoundary"}, actual.Context)
}

func Test_sourceMapsStoreImpl_ReadFromFileSystemAndDownload(t *testing.T) {
Expand Down

0 comments on commit 41a8310

Please sign in to comment.