opengb icon indicating copy to clipboard operation
opengb copied to clipboard

Add more explicit error if module or script is not found

Open NathanFlurry opened this issue 8 months ago • 3 comments

Motivation

Current error when trying to call a script that doesn't exist is:

Calling http://localhost:6420/modules/users/scripts/authenticate_user/call
error: Uncaught (in promise) Error: Request to users.authenticate_user failed: {"message":"Route not found. Make sure the URL and method are correct."}
                throw new Error(`Request to ${mod}.${script} failed: ` + await response.text());
                      ^
    at callScript (file:///Users/nathan/misc/opengb-test/test.ts:28:9)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async file:///Users/nathan/misc/opengb-test/test.ts:86:22

Implementation

We should return an explicit error saying that the script doesn't exist. Throw a different error if a module doesn't exist.

NathanFlurry avatar Jun 20 '24 21:06 NathanFlurry