Skip to content

Commit

Permalink
Fix/panicgrb (#289)
Browse files Browse the repository at this point in the history
* Better make file

* Return the error after panic in LoadKnowledgeBaseFromReader, this to gain insight of what happened that causes panic when loading GRBs
  • Loading branch information
newm4n authored Feb 21, 2022
1 parent 167f0b2 commit 03efe71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ast/KnowledgeBase.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ func (lib *KnowledgeLibrary) LoadKnowledgeBaseFromReader(reader io.Reader, overw
defer func() {
if r := recover(); r != nil {
retKb = nil
logrus.Panicf("panic recovered during LoadKnowledgeBaseFromReader. send us your report to https://github.com/hyperjumptech/grule-rule-engine/issues")
retErr = fmt.Errorf("panic recovered during LoadKnowledgeBaseFromReader, recover \"%v\". send us your report to https://github.com/hyperjumptech/grule-rule-engine/issues", r)
logrus.Panicf("panic recovered during LoadKnowledgeBaseFromReader, recover \"%v\". send us your report to https://github.com/hyperjumptech/grule-rule-engine/issues", r)
}
}()

Expand Down

0 comments on commit 03efe71

Please sign in to comment.