Skip to content

Revert to manual returncode checking for subprocess error handling#10

Merged
alexdryden merged 4 commits intoindex_creatorsfrom
copilot/sub-pr-8-again
Feb 13, 2026
Merged

Revert to manual returncode checking for subprocess error handling#10
alexdryden merged 4 commits intoindex_creatorsfrom
copilot/sub-pr-8-again

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Reverts subprocess error handling in index_collections to match the original maintainer's preferred pattern: manual returncode checking instead of exception-based handling with check=True.

Changes

  • Removed check=True from subprocess.run() call
  • Restored explicit result.returncode checking with if/else branching
  • Kept CalledProcessError exception handler (original defensive coding style)

Code Pattern

Before (exception-based):

result = subprocess.run(cmd, stderr=subprocess.PIPE, check=True)
if result.stderr:
    self.log.error(stderr)
except subprocess.CalledProcessError as e:
    self.log.error(f"Error: {e}")
else:
    self.log.info("Finished indexing...")

After (manual checking):

result = subprocess.run(cmd, stderr=subprocess.PIPE)
if result.stderr:
    self.log.error(stderr)
if result.returncode != 0:
    self.log.error(f"Failed... Return code: {result.returncode}")
else:
    self.log.info("Finished indexing...")
except subprocess.CalledProcessError as e:
    self.log.error(f"Error: {e}")

This matches the coding style familiar to the primary repository maintainer.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback on creator record generation Fix subprocess error handling in index_collections method Feb 13, 2026
Copilot AI requested a review from alexdryden February 13, 2026 17:07
Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
Copilot AI changed the title Fix subprocess error handling in index_collections method Fix subprocess exception handling in index_collections Feb 13, 2026
Co-authored-by: alexdryden <47127862+alexdryden@users.noreply.github.com>
Copilot AI changed the title Fix subprocess exception handling in index_collections Revert to manual returncode checking for subprocess error handling Feb 13, 2026
@alexdryden alexdryden marked this pull request as ready for review February 13, 2026 17:33
@alexdryden alexdryden merged commit db949e2 into index_creators Feb 13, 2026
@alexdryden alexdryden deleted the copilot/sub-pr-8-again branch February 19, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants