Skip to content

chore: throw error object #134

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

Merged
merged 2 commits into from
Apr 10, 2025
Merged

chore: throw error object #134

merged 2 commits into from
Apr 10, 2025

Conversation

incognitojam
Copy link
Collaborator

It's best practice to throw Error objects - will include stacktrace and more details could be attached

@incognitojam incognitojam requested a review from Copilot April 10, 2025 19:06
Copy link
Contributor

@Copilot 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.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (4)

src/workers/image.worker.js:52

  • [nitpick] Consider including the original error as a cause (if supported by your runtime) by using the Error constructor option (e.g., throw new Error(Error opening file handle: ${e}, { cause: e })).
throw new Error(`Error opening file handle: ${e}`)

src/workers/image.worker.js:78

  • [nitpick] Consider including the original error as a cause by passing it in the Error constructor options (e.g., { cause: e }) for better debugging.
throw new Error(`Error unpacking archive: ${e}`)

src/workers/image.worker.js:95

  • [nitpick] Consider preserving the original error by using the cause option in the Error constructor (e.g., { cause: e }) to include additional debugging information.
throw new Error(`Error getting file handle: ${e}`)

src/utils/manager.js:192

  • [nitpick] If this throw is within a try-catch block, consider including the caught error as a cause (e.g., { cause: err }) to ensure full error context is preserved.
throw new Error('Manifest is empty')

@incognitojam incognitojam merged commit 4b1a707 into master Apr 10, 2025
2 checks passed
@incognitojam incognitojam deleted the throw-error branch April 10, 2025 19:10
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