Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Throw error if no database URL is provided#7

Closed
josephrocca wants to merge 1 commit intoreplit:masterfrom
josephrocca:patch-2
Closed

Throw error if no database URL is provided#7
josephrocca wants to merge 1 commit intoreplit:masterfrom
josephrocca:patch-2

Conversation

@josephrocca
Copy link

Users may try to run code that contains repl.it db usage when they are not logged in. Currently, if they do this, they receive the following error message:

(node:83) UnhandledPromiseRejectionWarning: TypeError: Only absolute URLs are supported
    at getNodeRequestOptions (/home/runner/LimitedIncompatibleScale/node_modules/node-fetch/lib/index.js:1305:9)
    at /home/runner/LimitedIncompatibleScale/node_modules/node-fetch/lib/index.js:1410:19
    at new Promise (<anonymous>)
    at fetch (/home/runner/LimitedIncompatibleScale/node_modules/node-fetch/lib/index.js:1407:9)
    at Client.set (/home/runner/LimitedIncompatibleScale/node_modules/@replit/database/index.js:57:11)
    at /home/runner/LimitedIncompatibleScale/index.js:6:16
    at /home/runner/LimitedIncompatibleScale/index.js:9:3
    at Script.runInContext (vm.js:130:18)
    at Object.<anonymous> (/run_dir/interp.js:209:20)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
(node:83) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:83) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Copy link

@tekwiz tekwiz left a comment

Choose a reason for hiding this comment

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

+1

@masad-frost
Copy link
Member

thank you, resolved in another PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants