Skip to content

Conversation

@adamrefaey
Copy link
Collaborator

Change

  • Enhance error handling in ReportsService for DynamoDB operations
  • Added specific error handling for ValidationException and ProvisionedThroughputExceededException in multiple methods of ReportsService.
  • Improved logging for validation errors and throughput issues, providing clearer feedback for report updates and bookmark toggling.
  • Updated InternalServerErrorException messages to include more context about the errors encountered.

Does this PR introduce a breaking change?

{...}

What needs to be documented once your changes are merged?

{...}

Additional Comments

{...}

- Added specific error handling for ValidationException and ProvisionedThroughputExceededException in multiple methods of ReportsService.
- Improved logging for validation errors and throughput issues, providing clearer feedback for report updates and bookmark toggling.
- Updated InternalServerErrorException messages to include more context about the errors encountered.
@adamrefaey adamrefaey requested a review from GuidoBR April 25, 2025 17:40
@adamrefaey adamrefaey self-assigned this Apr 25, 2025
@adamrefaey adamrefaey requested a review from Copilot April 25, 2025 17:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances error handling in ReportsService for DynamoDB operations by adding specific branches for ValidationException and ProvisionedThroughputExceededException, and by improving logging messages. Additionally, the update expression in the report update method now uses ExpressionAttributeNames to safely handle reserved keywords.

Comments suppressed due to low confidence (2)

backend/src/reports/reports.service.ts:290

  • Consider extracting the error name strings, such as 'ValidationException' and 'ProvisionedThroughputExceededException', into constants or an enum to reduce duplication and mitigate potential typos.
        } else if (error.name === 'ValidationException') {

backend/src/reports/reports.service.ts:287

  • [nitpick] The repeated pattern of logging the error and throwing an InternalServerErrorException across multiple branches could be refactored into a helper function, reducing duplication and simplifying future maintenance.
            throw new InternalServerErrorException(`Table "${this.tableName}" not found. Please check your database configuration.`);

@GuidoBR GuidoBR merged commit cc00864 into main Apr 25, 2025
1 check passed
@adamrefaey adamrefaey deleted the ADE-66 branch April 25, 2025 17:45
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.

3 participants