Merge pull request #26 from navi-ppl/TP-5555/discard-invalid-frames
Tp 5555/discard invalid frames
This commit is contained in:
@@ -76,6 +76,10 @@ func extractFilename(url string) string {
|
||||
// Remove any trailing characters you don't want (in case there are any)
|
||||
url = strings.Trim(url, `"`)
|
||||
|
||||
// Check if the URL starts with "app:///" and remove the scheme if present this is to parse react native file names
|
||||
if strings.HasPrefix(url, "app:///") {
|
||||
return strings.TrimPrefix(url, "app:///") + ".map"
|
||||
}
|
||||
// Extract the base (filename) from the URL path
|
||||
filename := path.Base(url)
|
||||
return filename + ".map"
|
||||
@@ -104,7 +108,8 @@ func (ep *ErrorProcessor) ProcessError(error []byte) {
|
||||
fileName := extractFilename(frame.Filename)
|
||||
projectId := payload.ProjectId
|
||||
frame := &payload.Stacktrace.Frames[i]
|
||||
|
||||
ep.logger.Info("processing frame", zap.String("filename", fileName))
|
||||
ep.logger.Info("processing frame", zap.String("filename", frame.SourceMapPath))
|
||||
//todo make release dynamic
|
||||
sourceMapPath, err := ep.sourceMapFetcher.GetSourceMap(fileName, projectId, releaseId, ep.awsConfig.Bucket)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user