Browse Source

return error after sync

Anton Lebedevich 13 years ago
parent
commit
cc4e7aa8ed
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/pgsql.erl

+ 3 - 2
src/pgsql.erl

@@ -118,8 +118,9 @@ with_transaction(C, F) ->
             {rollback, Why}
     end.
 
-sync_on_error(C, {error, _}) ->
-    sync(C);
+sync_on_error(C, Error = {error, _}) ->
+    ok = sync(C),
+    Error;
 
 sync_on_error(_C, R) ->
     R.