pion / sdp

A Go implementation of the SDP
https://pion.ly/
MIT License
148 stars 56 forks source link

Cleanup lexer syntax errors #141

Closed aconverse closed 2 years ago

aconverse commented 2 years ago

Description

This shortens SDP lexer errors to a single line like: syntax error: at pos 50: "=".

Currently SDP lexer errors are formatted with the whole SDP echoed and a cursor like ==> <== around the where the lexer found an unexpected character. These errors are difficult to log and difficult to detect as invalid SDPs.

Reference issue

Fixes #140

Sean-Der commented 2 years ago

@aconverse just one test error blocking CI

codecov[bot] commented 2 years ago

Codecov Report

Merging #141 (5102788) into master (29624ba) will decrease coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
- Coverage   61.18%   61.15%   -0.03%     
==========================================
  Files          11       11              
  Lines        1332     1331       -1     
==========================================
- Hits          815      814       -1     
  Misses        415      415              
  Partials      102      102              
Flag Coverage Δ
go 61.15% <100.00%> (-0.03%) :arrow_down:
wasm 61.15% <100.00%> (-0.03%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
base_lexer.go 70.88% <100.00%> (-0.19%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Sean-Der commented 2 years ago

Tagged v3.0.6