From 499b5b761596b30f897123665ded9cc48b8dad59 Mon Sep 17 00:00:00 2001 From: shenli Date: Mon, 4 Jan 2016 13:32:35 +0800 Subject: [PATCH] scope: Catch error for db.Commit() --- scope.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope.go b/scope.go index 0003d575..a11d4ec4 100644 --- a/scope.go +++ b/scope.go @@ -380,7 +380,7 @@ func (scope *Scope) CommitOrRollback() *Scope { if scope.HasError() { db.Rollback() } else { - db.Commit() + scope.Err(db.Commit()) } scope.db.db = scope.db.parent.db }