Skip to content

Commit a83722c

Browse files
authored
fix(fetch-wrapper): improve error message when 'fetch' implementation is not present (#617)
chore(fetch-wrapper): improve error message when 'fetch' implementation is not present
1 parent 110f3c4 commit a83722c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/fetch-wrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function fetchWrapper(
3232

3333
if (!fetch) {
3434
throw new Error(
35-
'Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.',
35+
"fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing",
3636
);
3737
}
3838

test/request.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ x//0u+zd/R/QRUzLOw4N72/Hu+UG6MNt5iDZFCtapRaKt6OvSBwy8w==
396396
}
397397
globalThis.fetch = originalFetch;
398398
expect(error?.message).toEqual(
399-
'Global "fetch" not found. Please provide `options.request.fetch` to octokit or upgrade to node@18 or newer.',
399+
"fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing",
400400
);
401401
});
402402

0 commit comments

Comments
 (0)