Skip to content

Fix(attachments): Improve Error Handling in Upload Lifecycle and Non-draft Upload Flow #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

RoshniNaveenaS
Copy link
Contributor

@RoshniNaveenaS RoshniNaveenaS commented Jul 24, 2025

This PR addresses issue #227 with better error handling, especially for non-draft attachment uploads:
• Added robust error handling and logging in attachment creation and upload handlers.
• Improved validation and rejection of invalid requests to prevent unhandled exceptions.
• Enhanced overall stability to avoid server crashes during file upload operations.

Also the documentation update is also covered as part of this PR

These changes improve reliability and make debugging easier.

…t operations

	Wrapped nonDraftHandler(), put(), and updateContentHandler() in try/catch blocks to ensure proper error propagation using req.error(...).
	•	Ensured await super.put(...) is followed by error-safe logic in put().
	•	Invoked scanRequest() asynchronously with catch() to avoid crashing on malware scanner failures.
	•	Prevented unhandled exceptions during file uploads and metadata updates in non-draft flow.
…raftUpload

- Wrap srv.before("NEW"/"CREATE") handler with try/catch to log errors and reject on failure during attachment initialization
- Update nonDraftUpload function to handle errors gracefully, log failures, and reject to prevent unhandled exceptions

Improves robustness by preventing crashes due to unhandled errors in attachment upload lifecycle.
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