Skip to content

Commit

Permalink
Throw error when parsing invalid section0 indicator (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
measuredweighed committed Feb 11, 2020
1 parent 7406017 commit 88c99b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion griblib/sections.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ func ReadSection0(reader io.Reader) (section0 Section0, err error) {

if section0.Indicator == Grib {
if section0.Edition != SupportedGribEdition {
return section0, fmt.Errorf("Unsupported grib edition %d", section0.Edition)
return section0, fmt.Errorf("Unsupported grib edition %d", section0.Edition)
}
} else {
return section0, fmt.Errorf("Unsupported grib indicator %d", section0.Indicator)
}

return
Expand Down

0 comments on commit 88c99b3

Please sign in to comment.