From dc5da4f37ea087318b3298f035bb923064ff2fa3 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 26 Jun 2020 13:40:19 +0300 Subject: [PATCH] compiler: fix unhandled error --- pkg/compiler/compiler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index 292b5d7bd..c17f33e2f 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -109,9 +109,12 @@ func CompileAndSave(src string, o *Options) ([]byte, error) { } out := fmt.Sprintf("%s.%s", o.Outfile, o.Ext) err = ioutil.WriteFile(out, bytes, os.ModePerm) - if o.DebugInfo == "" { + if err != nil { return b, err } + if o.DebugInfo == "" { + return b, nil + } p, err := filepath.Abs(src) if err != nil { return b, err