Skip to content

Commit

Permalink
Fix parse error handling when statement line is missing (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlinsley authored Jul 12, 2024
1 parent 44bb410 commit 6a9f35b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions logs/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -1284,11 +1284,13 @@ func classifyAndSetDetails(logLine state.LogLine, statementLine state.LogLine, d
logLine.Classification = syntaxError.classification
// The statement already has a LogSecretMarker, but we add another one so it's
// redacted for both `statement_text` and `parsing_error` log filters.
statementLine.SecretMarkers = append(statementLine.SecretMarkers, state.LogSecretMarker{
ByteStart: statementLine.SecretMarkers[0].ByteStart,
ByteEnd: statementLine.SecretMarkers[0].ByteEnd,
Kind: state.ParsingErrorLogSecret,
})
if len(statementLine.SecretMarkers) > 0 {
statementLine.SecretMarkers = append(statementLine.SecretMarkers, state.LogSecretMarker{
ByteStart: statementLine.SecretMarkers[0].ByteStart,
ByteEnd: statementLine.SecretMarkers[0].ByteEnd,
Kind: state.ParsingErrorLogSecret,
})
}
return logLine, statementLine, detailLine, contextLine, hintLine, samples
}
}
Expand Down

0 comments on commit 6a9f35b

Please sign in to comment.