Skip to content

Conversation

@Satvik-Singh192
Copy link
Contributor

Description

This pull request implements the error handling required by Issue #8 for the load function in app/etl/load.py.

It wraps the core database logic in a try...except...finally block. This change ensures that:

  1. Any sqlite3.Error or general Exception during the database operation is caught.
  2. The transaction is rolled back (conn.rollback()) if an error occurs, preventing partial or corrupt data writes.
  3. The database connection (conn.close()) is always closed in the finally block, even if an error happens.

This resolves the "Error handling missing" and "Connection not closed properly" TODOs for this specific issue.

Semver Changes

  • Patch (bug fix, no new features)
  • Minor (new features, no breaking changes)
  • Major (breaking changes)

Issues

Closes #8

Checklist

Implements database rollback and connection closing in case of an error.

Resolves: OPCODE-Open-Spring-Fest#8
@Satvik-Singh192 Satvik-Singh192 force-pushed the feat/add-load-error-handling-8 branch from cb1ce67 to 0a6d09d Compare October 23, 2025 11:11
@Dheerajyadav1 Dheerajyadav1 merged commit 7b3d740 into OPCODE-Open-Spring-Fest:main Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Error Handling in Load Function

2 participants