You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2023/01/19 03:18:58 UTC

[incubator-devlake] branch release-v0.14 updated: fix: dbt error not return (#4237)

This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch release-v0.14
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.14 by this push:
     new 535258efb fix: dbt error not return (#4237)
535258efb is described below

commit 535258efb521a622f93d2adcccfaf8d6d8107187
Author: long2ice <ji...@merico.dev>
AuthorDate: Thu Jan 19 11:18:52 2023 +0800

    fix: dbt error not return (#4237)
---
 plugins/dbt/tasks/convertor.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/dbt/tasks/convertor.go b/plugins/dbt/tasks/convertor.go
index cd6580256..06620eb81 100644
--- a/plugins/dbt/tasks/convertor.go
+++ b/plugins/dbt/tasks/convertor.go
@@ -187,18 +187,18 @@ func DbtConverter(taskCtx core.SubTaskContext) errors.Error {
 	if err != nil {
 		return err
 	}
+	var errStr string
 	// ProcessState contains information about an exited process, available after a call to Wait.
 	defer func() {
 		if !cmd.ProcessState.Success() {
 			log.Error(nil, "dbt run task error, please check!!!")
+			err = errors.SubtaskErr.New(errStr)
 		}
 	}()
 
 	// prevent zombie process
 	defer cmd.Wait() //nolint
-
 	scanner := bufio.NewScanner(stdout)
-	var errStr string
 	for scanner.Scan() {
 		line := scanner.Text()
 		log.Info(line)
@@ -213,7 +213,7 @@ func DbtConverter(taskCtx core.SubTaskContext) errors.Error {
 		return err
 	}
 
-	return nil
+	return err
 }
 
 var DbtConverterMeta = core.SubTaskMeta{