apache / cordova-discuss

Discussions on features and the future
19 stars 28 forks source link

Confusing UnhandledPromiseRejectionWarning if plugin.xml has lingering diff markers [minor] #84

Closed brodycj closed 6 years ago

brodycj commented 6 years ago

If I would test a plugin with lingering "<<<<<<" markers from git merge I get the following confusing output on the latest version of Cordova CLI (8.0.0):

(node:23173) UnhandledPromiseRejectionWarning: CordovaError: Invalid attribute name
Line: 3
Column: 1
Char: <
    at /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:112:45
    at _rejected (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:864:24)
    at /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:890:30
    at Promise.when (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:808:41)
    at /Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:624:44
    at runSingle (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:137:13)
    at flush (/Users/brodybits/.nvs/node/9.3.0/x64/lib/node_modules/cordova/node_modules/q/q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:150:11)
(node:23173) 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(). (rejection id: 1)
(node:23173) [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.

A more informative error message such as "syntax error in plugin.xml" would be much better.

I would consider this to be a minor bug. I think a more informative error message would be extremely helpful for the newer plugin developers.

janpio commented 6 years ago

This is not a bug tracker for Cordova. Please open an issue at http://issues.cordova.io