diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js
index <HASH>..<HASH> 100644
--- a/lib/platform/github/index.js
+++ b/lib/platform/github/index.js
@@ -1014,10 +1014,15 @@ async function commitFilesToBranch(
     gitPrivateKey
   );
   const isBranchExisting = await branchExists(branchName);
-  if (isBranchExisting) {
-    await updateBranch(branchName, commit);
-  } else {
-    await createBranch(branchName, commit);
+  try {
+    if (isBranchExisting) {
+      await updateBranch(branchName, commit);
+    } else {
+      await createBranch(branchName, commit);
+    }
+  } catch (err) /* istanbul ignore next */ {
+    logger.debug({ files });
+    throw err;
   }
 }
refactor: log files if commit files to branch fails