Surface parse errors instead of silently discarding them - #24
Conversation
Add ParseError type and ParseErrors fields to Train, StationTrain, and StationStop structs. Parse errors from time and coordinate parsing are now collected and made available to callers for inspection, rather than being silently discarded.
There was a problem hiding this comment.
Code Review
This pull request introduces a custom ParseError type and updates the client to capture and expose parsing errors for dates, times, and coordinates within the StationTrain, StationStop, and Train structs, rather than silently ignoring them. Unit tests have also been added to verify this new error-handling behavior. The feedback points out that in vehicle_data.go, the error check for parseLatLng is deferred until after the Train struct initialization, which is non-idiomatic in Go and should be handled immediately after the function call.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #24 +/- ##
==========================================
+ Coverage 85.91% 88.25% +2.34%
==========================================
Files 5 5
Lines 291 349 +58
==========================================
+ Hits 250 308 +58
Misses 24 24
Partials 17 17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #14
ParseErrortype with Field, Value, and underlying errorParseErrors []errorfield toTrain,StationTrain, andStationStopstructs