Skip to content

fix: Better optional deps handling#353

Merged
abmusse merged 3 commits intomasterfrom
better-optional-deps-error-messages
Oct 27, 2022
Merged

fix: Better optional deps handling#353
abmusse merged 3 commits intomasterfrom
better-optional-deps-error-messages

Conversation

@abmusse
Copy link
Member

@abmusse abmusse commented Oct 26, 2022

odbc and idb-connector are optional deps and might not be installed.
When either is not available, return an error back to user instead of failing.

Fixes #317

@abmusse abmusse requested review from kadler and markirish October 26, 2022 21:58
The odbc and idb are optional deps that might not be installed.
When either is not available, return an error back to user
instead of failing.
@abmusse abmusse force-pushed the better-optional-deps-error-messages branch from 2b3b4a0 to 53f9bf1 Compare October 26, 2022 22:32
@abmusse abmusse added this to the Version 1.1 milestone Oct 27, 2022
function idbCall(config, xmlInput, cb) {
// idb transport is not available bail out
if (idb === null) {
cb(new Error('idb-connector module was not found, the idb transport is only usable on IBM i.'), null);
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like

"idb-connector was not found, ensure idb-connector is installed properly (idb-connector is only available on IBM i)"

I get nervous about the term "module", since idb-connector doesn't have type: module in its package.json, which affects all sorts of things (CJS vs. ESM modules)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good to me!

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed up in: 12083c9

@abmusse abmusse requested a review from markirish October 27, 2022 13:46
Copy link
Contributor

@markirish markirish left a comment

Choose a reason for hiding this comment

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

LGTM

@abmusse abmusse merged commit f896ef9 into master Oct 27, 2022
@abmusse abmusse deleted the better-optional-deps-error-messages branch October 27, 2022 19:17
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.

Return a better error when optional deps are not found

2 participants