Uploaded image for project: 'Magnolia CLI'
  1. Magnolia CLI
  2. NPMCLI-110

Fail gracefully if custom config is missing file

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1.0
    • Labels:
      None
    • Sprint:
      Basel 86
    • Story Points:
      1

      Description

      If for some reason a file is missing from a custom configuration, users get a confusing, useless stack trace

      ~/dev/mgnl-bundles/multi/multi-light-modules $ mgnl create-light-module visits-cookie-365
      info Using configuration at /Users/foo/dev/mgnl-cli.json
      info Using prototypes at /Users/foo/dev/mgnl-cli-prototypes
      info No path option provided, light module will be created in the current folder.
      ERR! /Users/foo/dev/mgnl-cli-prototypes/README.md.tpl doesn't exist
      ERR! Error: /Users/foo/dev/mgnl-cli-prototypes/README.md.tpl doesn't exist
      ERR!     at Object.create (/usr/local/lib/node_modules/@magnolia/cli/lib/createFromPrototype.js:14:11)
      ERR!     at /usr/local/lib/node_modules/@magnolia/cli/lib/createLightModule.js:67:25
      ERR!     at tryCatcher (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/util.js:16:23)
      ERR!     at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/promise.js:510:31)
      ERR!     at Promise._settlePromise (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/promise.js:567:18)
      ERR!     at Promise._settlePromise0 (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/promise.js:612:10)
      ERR!     at Promise._settlePromises (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/promise.js:691:18)
      ERR!     at Async._drainQueue (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/async.js:133:16)
      ERR!     at Async._drainQueues (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/async.js:143:10)
      ERR!     at Immediate.Async.drainQueues (/usr/local/lib/node_modules/@magnolia/cli/node_modules/bluebird/js/release/async.js:17:14)
      ERR!     at runCallback (timers.js:649:20)
      ERR!     at tryOnImmediate (timers.js:622:5)
      ERR!     at processImmediate [as _immediateCallback] (timers.js:594:5)
      ERR!
      ERR!
      ERR! mgnl: 2.0.1-snapshot-182 node: v6.9.5 os: darwin
      

        Attachments

          Activity

            People

            • Assignee:
              fgrilli Federico Grilli
              Reporter:
              fgrilli Federico Grilli
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: