Skip to content

Improve exception handling with specific exception types#84

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/repository-code-quality-43c6
Draft

Improve exception handling with specific exception types#84
cursor[bot] wants to merge 1 commit intomainfrom
cursor/repository-code-quality-43c6

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented Mar 14, 2026

Replace bare except Exception: blocks with specific exception types for better error handling and debuggability. This includes Selenium exceptions (NoSuchElementException, TimeoutException, StaleElementReferenceException), file I/O exceptions (FileNotFoundError, OSError), and data parsing exceptions (ValueError, IndexError, AttributeError).

Open in Web View Automation 

- Improve exception handling specificity in linkedin.py by replacing broad 'except Exception' blocks with specific Selenium exceptions (NoSuchElementException, TimeoutException, StaleElementReferenceException, ElementNotInteractableException)
- Add specific exception handling for file operations (FileNotFoundError, OSError, IOError)
- Add specific exception handling for data parsing (ValueError, IndexError, AttributeError)
- Improve utils.py exception handling for file I/O operations
- This improves debuggability and follows Python best practices for error handling

Co-authored-by: Ongun Demirag <ongun@ongundemirag.com>
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.

1 participant