aboutsummaryrefslogtreecommitdiffstats
path: root/singleton_ctx.go
diff options
context:
space:
mode:
Diffstat (limited to 'singleton_ctx.go')
-rw-r--r--singleton_ctx.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/singleton_ctx.go b/singleton_ctx.go
index 07e5108..a2d6109 100644
--- a/singleton_ctx.go
+++ b/singleton_ctx.go
@@ -91,15 +91,21 @@ func (s *singletonContext) BlueprintFile(logicModule Module) string {
return s.context.BlueprintFile(logicModule)
}
+func (s *singletonContext) error(err error) {
+ if err != nil {
+ s.errs = append(s.errs, err)
+ }
+}
+
func (s *singletonContext) ModuleErrorf(logicModule Module, format string,
args ...interface{}) {
- s.errs = append(s.errs, s.context.ModuleErrorf(logicModule, format, args...))
+ s.error(s.context.ModuleErrorf(logicModule, format, args...))
}
func (s *singletonContext) Errorf(format string, args ...interface{}) {
// TODO: Make this not result in the error being printed as "internal error"
- s.errs = append(s.errs, fmt.Errorf(format, args...))
+ s.error(fmt.Errorf(format, args...))
}
func (s *singletonContext) Failed() bool {