From 551b94b6e502b9e30eda4bb35373086d2af35fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20L=C3=B6nnblad?= Date: Thu, 5 Mar 2020 14:25:05 -0300 Subject: [PATCH] Added better defined panics when scenarios and steps couldn't be found --- fmt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fmt.go b/fmt.go index 608cd09..d667ff3 100644 --- a/fmt.go +++ b/fmt.go @@ -213,7 +213,7 @@ func (f *basefmt) findScenario(scenarioAstID string) *messages.GherkinDocument_F } } - return nil + panic("Couldn't find scenario for AST ID: " + scenarioAstID) } func (f *basefmt) findBackground(scenarioAstID string) *messages.GherkinDocument_Feature_Background { @@ -243,7 +243,7 @@ func (f *basefmt) findStep(stepAstID string) *messages.GherkinDocument_Feature_S } } - return nil + panic("Couldn't find step for AST ID: " + stepAstID) } func (f *basefmt) Pickle(p *messages.Pickle) {