martindstone / pagerduty-cli

A command line interface for PagerDuty
MIT License
91 stars 12 forks source link

fix(incident:open): when no xdg-open exists, show the url #17

Closed georgettica closed 3 years ago

georgettica commented 3 years ago

I am using pdcli in a container the doesn't have xdg-open

I would like it to fail on "cannot access url " so I can copy it from there and continue but I get (also with --debug)

(node:1518) UnhandledPromiseRejectionWarning: Error: spawn xdg-open ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1518) 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: 1)
(node:1518) [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.
(node:1518) UnhandledPromiseRejectionWarning: Error: spawn xdg-open ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(node:1518) 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: 2)
martindstone commented 3 years ago

I will do this

martindstone commented 3 years ago

hi @georgettica , I just uploaded 0.0.76, which should be friendlier when a browser can't be opened. Can you check it out and let me know if this resolves the issue for you?

georgettica commented 3 years ago

I'll let you know :)

georgettica commented 2 years ago

tried it now and it looks great!


 pd incident:open -i XXX
Incident URLs:
https://YYY.pagerduty.com/incidents/XXX

Opening 1 incidents in the browser... failed!
 ›   Error: Couldn't open your browser. Are you running as root?