You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my case I have a hook that executes before platform remove. If this throws an exception, the command stops.
What is expected to happen?
I expect a non zero exit code
What does actually happen?
I get an exit code of 0
PS C:\Cordova> lcordova platform rm android
checking file: package.json
File package.json can be read and written
checking file: package-lock.json
File package-lock.json can be read and written
checking file: config.xml
(node:54088) UnhandledPromiseRejectionWarning: Error: File is not writable: config.xml
at \hooks\areKeyFilesWritable.js:40:10
at Array.forEach ()
at module.exports (hooks\areKeyFilesWritable.js:23:8)
at runScriptViaModuleLoader (hooks\HooksRunner.js:157:32)
at runScript (hooks\HooksRunner.js:136:12)
at hooks\HooksRunner.js:108:40
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:54088) 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:54088) [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.
PS C:\Cordova>echo $lastExitCode
0
Information
Command or Code
config.xml:
areKeyFilesWritable.js
throw new Error("threw an error");
Bug Report
It would appear the cordova cli always returns an exit code of 0.
I have found this related post which describes a similar issue: https://issues.apache.org/jira/browse/CB-13959
Problem
In my case I have a hook that executes before platform remove. If this throws an exception, the command stops.
What is expected to happen?
I expect a non zero exit code
What does actually happen?
I get an exit code of 0
PS C:\Cordova> lcordova platform rm android
checking file: package.json
File package.json can be read and written
checking file: package-lock.json
File package-lock.json can be read and written
checking file: config.xml
(node:54088) UnhandledPromiseRejectionWarning: Error: File is not writable: config.xml
at \hooks\areKeyFilesWritable.js:40:10
at Array.forEach ()
at module.exports (hooks\areKeyFilesWritable.js:23:8)
at runScriptViaModuleLoader (hooks\HooksRunner.js:157:32)
at runScript (hooks\HooksRunner.js:136:12)
at hooks\HooksRunner.js:108:40
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:54088) 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:54088) [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.
PS C:\Cordova>echo $lastExitCode
0
Information
Command or Code
config.xml:
areKeyFilesWritable.js
throw new Error("threw an error");
Environment, Platform, Device
Windows 10, Powershell
Version information
Cordova Packages:
Project Installed Platforms:
Project Installed Plugins:
N/A
Environment:
Checklist
The text was updated successfully, but these errors were encountered: