-
Notifications
You must be signed in to change notification settings - Fork 245
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
feat: use new read/load assembly functions everywhere #3600
Conversation
…ath always loads SPEC_FILE_NAME first
…onroy/jsiiutils-extension
…onroy/jsiiutils-extension
packages/@jsii/kernel/src/kernel.ts
Outdated
} catch { | ||
throw new Error( | ||
`Package tarball ${req.tarball} must have a file named ${spec.SPEC_FILE_NAME} at the root`, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blind catch is a bit of an anti-pattern. The throw
underneath makes wild assumptions about what failed. It should at least log the actual thing it caught here...
} catch (e: any) { | ||
throw new Error(`Error for package tarball ${req.tarball}: ${e.message}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, @RomainMuller, is this better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yap
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
1 similar comment
Merging (with squash)... |
This PR utilizes the functions added in #3570 everywhere in the jsii monorepo. The benefit of this is two-fold -- it refactors all places where we load/read assemblies and points them to the source of truth (introduced in #3570). This also means the logic for compressing assemblies will be available for all packages in the jsii monorepo if/when we flip that switch.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.