30a4424ce1b185ef0e6e95969e0b688d686dfb8d
chmalee
  Wed May 6 11:52:40 2026 -0700
HubSpace assembly hub fixes: fixes 1,5,6,8 and prettify error messages, refs #37411

diff --git src/hg/hgHubConnect/hooks/pre-finish.c src/hg/hgHubConnect/hooks/pre-finish.c
index 3d7eea2adbe..1a5ade8b314 100644
--- src/hg/hgHubConnect/hooks/pre-finish.c
+++ src/hg/hgHubConnect/hooks/pre-finish.c
@@ -230,42 +230,44 @@
                     // user's hub.txt is authoritative; just flip rows to assemblyHub.
                     upgradeExistingHubToAssembly(row, userDataDir, encodedParentDir);
                     }
                 }
             unlockHubDir(hubLockFd);
             // first make the parentDir rows
             makeParentDirRows(row->userName, sqlDateToUnixTime(row->lastModified), row->db, row->parentDir, userDataDir, row->hubType);
             row->parentDir = encodedParentDir ? hubNameFromPath(encodedParentDir) : "";
             addHubSpaceRowForFile(row);
             fprintf(stderr, "added hubSpace row for file '%s'\n", fileName);
             fflush(stderr);
             }
         }
     if (errCatch->gotError)
         {
+        // App-level reject: exit 0 + RejectUpload=true is the tusd protocol for
+        // forwarding HTTPResponse verbatim. Non-zero gets wrapped.
         rejectUpload(response, errCatch->message->string);
         // must remove the tusd temp files so if the users tries again after a temp error
         // the upload will work
         if (tusFile)
             {
             mustRemove(tusFile);
             mustRemove(tusInfo);
             }
         // TODO: if the first mysql request in createNewTempHubForUpload() works but then
         // either of makeParentDirRows() or addHubSpaceRowForFile() fails, we need to also
         // drop any rows we may have added because the upload didn't full go through
-        exitStatus = 1;
+        exitStatus = 0;
         }
     errCatchEnd(errCatch);
     }
 // always print a response no matter what
 jsonPrintToFile(response, NULL, stdout, 0);
 return exitStatus;
 }
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 optionInit(&argc, argv, options);
 if (argc != 1)
     usage();
 return preFinish();