Skip to content

fix: check for is error catalog error [CSENG-169]#6629

Merged
brew42 merged 9 commits intomainfrom
fix/CSENG-169/check-isErrorCatalogError
Mar 16, 2026
Merged

fix: check for is error catalog error [CSENG-169]#6629
brew42 merged 9 commits intomainfrom
fix/CSENG-169/check-isErrorCatalogError

Conversation

@brew42
Copy link
Contributor

@brew42 brew42 commented Mar 9, 2026

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages
    are release-note ready, emphasizing
    what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High)
  • Highlights breaking API changes (if applicable)
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___)
  • Includes product update to be announced in the next stable release notes

What does this PR do?

Adds a further check for catalog errors returned from plugin
Updates error catalog version with new python errors
Updates the snyk-python-plugin version with updates error handling

See json error object in error-catalog-nodejs-public/src/problem-error.ts, isErrorCatalogError = true

Where should the reviewer start?

Review error check change

How should this be manually tested?

snky cli & sbom tests to verify correct error codes being returned to the user

Test the following scenarios with python repo

  • Invalid entry in requirements.txt
  • Empty requirements.txt file
  • Dependencies not installed from requirements.txt file

What's the product update that needs to be communicated to CLI users?

N/A

Risk assessment (Low | Medium | High)?

Low risk

Any background context you want to provide?

Customers have reported several scenarios where they receive the generic error code SNYK-0000. Our goal is to return more meaningful information to help customers better understand the issue and troubleshoot more effectively.

This change is being implemented alongside improvements in the Python plugin, which will also return more informative error codes.

What are the relevant tickets?

https://snyksec.atlassian.net/browse/CSENG-169

@brew42 brew42 requested review from a team as code owners March 9, 2026 19:54
@brew42 brew42 self-assigned this Mar 9, 2026
@brew42 brew42 marked this pull request as draft March 9, 2026 19:55
@snyk-io
Copy link

snyk-io bot commented Mar 9, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Warnings
⚠️

You've modified files in src/ directory, but haven't updated anything in test folder. Is there something that could be tested?

⚠️ There are multiple commits on your branch, please squash them locally before merging!

Generated by 🚫 dangerJS against 0dcdfc8

@snyk-pr-review-bot

This comment has been minimized.

@brew42 brew42 marked this pull request as ready for review March 10, 2026 09:23
@snyk-pr-review-bot

This comment has been minimized.

@brew42 brew42 force-pushed the fix/CSENG-169/check-isErrorCatalogError branch from a5c6477 to 2767f2b Compare March 10, 2026 11:46
@snyk-pr-review-bot

This comment has been minimized.

@brew42 brew42 requested a review from j-luong March 10, 2026 11:50
j-luong
j-luong previously approved these changes Mar 10, 2026
@j-luong j-luong dismissed their stale review March 10, 2026 12:02

may need another update

@j-luong
Copy link
Contributor

j-luong commented Mar 10, 2026

suggest: is there any acceptance testing we can add to test when isErrorCatalog === true?

@brew42 brew42 requested a review from j-luong March 10, 2026 13:26
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@brew42 brew42 requested a review from danskmt March 11, 2026 14:00
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot
Copy link

PR Reviewer Guide 🔍

🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Potential Runtime Error 🟡 [minor]

The catch block accesses properties like isErrorCatalogError and errorCatalog on the error object without verifying that error is non-null and an object. While this pattern is consistent with existing code in the file (e.g., at lines 394 and 397), if runTest catches a null or undefined value (which can happen in JavaScript/TypeScript), the attempt to read these properties will cause a TypeError, potentially masking the original failure.

if (error instanceof ProblemError || error.isErrorCatalogError) {
  catalogError = error as ProblemError;
} else {
  catalogError = error.errorCatalog;
}
📚 Repository Context Analyzed

This review considered 8 relevant code sections from 3 files (average relevance: 0.85)

@brew42 brew42 merged commit 6f3b856 into main Mar 16, 2026
9 checks passed
@brew42 brew42 deleted the fix/CSENG-169/check-isErrorCatalogError branch March 16, 2026 15:23
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