Ais.Net icon indicating copy to clipboard operation
Ais.Net copied to clipboard

NmeaLineParser should include argument name in `ArgumentException`

Open idg10 opened this issue 2 years ago • 4 comments

Also, the docs should state that the NmeaLineParser ctos throws an ArgumentException to report the discovery of bad data.

idg10 avatar Mar 28 '22 13:03 idg10

Hey @idg10 , we're using this library (at @dualog) and wanted to contribute back.

Could you clarify if you would like to have all of the ArgumentException s to reference the line input parameter? It's the only argument for the method but some of the argumentExceptions are being thrown on a subset of that line

See https://github.com/fredeil/Ais.Net/commit/2655552f56055596fb2a1abf37ba71a7b2fe1463

fredeil avatar Apr 05 '22 12:04 fredeil

Yes, I just meant that the relevant throws should use nameof(line) as the paramName argument when constructing the ArgumentException. (So exactly what you've done in that commit.)

Thanks for offering to do this. While you're in there would you mind adding an <exception> tag to the relevant XML doc comments, so it's clear to anyone using this library that this is how we report unparseable data?

idg10 avatar Apr 06 '22 07:04 idg10

Sure, that was my next question.

No more documentation needed outside of that? @idg10

fredeil avatar Apr 06 '22 08:04 fredeil

Nothing I'm aware of, but if you feel it's missing something feel free either to add more, or to open another issue describing what's missing.

idg10 avatar Apr 06 '22 08:04 idg10