forked from stephan83/download-github-release
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
When I supply a github user and project that doesn't exist I get a stack trace:
./bin/fetch-github-release -d -o json trycua luma
HTTPError: Response code 404 (Not Found)
at Request.<anonymous> (file:///Users/godber/Workspace/terascope/opensource/fetch-github-release/node_modules/got/dist/source/as-promise/index.js:86:42)
at Object.onceWrapper (node:events:634:26)
at Request.emit (node:events:531:35)
at Request._onResponseBase (file:///Users/godber/Workspace/terascope/opensource/fetch-github-release/node_modules/got/dist/source/core/index.js:726:22)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Request._onResponse (file:///Users/godber/Workspace/terascope/opensource/fetch-github-release/node_modules/got/dist/source/core/index.js:768:13) {
input: undefined,
code: 'ERR_NON_2XX_3XX_RESPONSE',It should do the following things in these cases:
- default txt output - should print a text error message saying the project FOO doesn't exist
-q- nothing printed--jsonshould return:
{
"error": "Project FOO doesn't exist." /// same message as above
}
In all cases the return code (echo $?) is set to non-zero (e.g. 1, make sure it's unique and documented in the code that the return code indicates the package doesn't exist.
Metadata
Metadata
Assignees
Labels
No labels