Skip to content

No error when scaffold source doesn't exist and prestissimo installed globally #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
datvance opened this issue Feb 21, 2018 · 4 comments · Fixed by #88
Closed

No error when scaffold source doesn't exist and prestissimo installed globally #73

datvance opened this issue Feb 21, 2018 · 4 comments · Fixed by #88

Comments

@datvance
Copy link

Not sure if this is an issue with drupal-scaffold or prestissimo, but if you have prestissimo installed globally, as per their docs, no errors or exceptions are thrown if the scaffold source cannot be found.

"drupal-scaffold": {
      "source": "https://raw.example.com/pantheon-systems/drops-8/{version}/{path}",

Should generate an error since example.com does not exist, but no errors:

$ composer install
...
Writing lock file
Generating optimized autoload files
$ cat web/.gitattributes
cat: web/.gitattributes: No such file or directory

After removing prestissimo, composer install correctly throws errors:

$ composer global remove hirak/prestissimo
$ composer install
...
Generating optimized autoload files
Downloading (failed)       
                                                                                                                                                                         
  [Composer\Downloader\TransportException]                                                                                                                               
  The "https://raw.example.com/pantheon-systems/drops-8/8.4.5/.gitattributes" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: nodename nor   
  servname provided, or not known                                                                                                                                        
  failed to open stream: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known                                                      
                                                                                                                                                                         
Exception trace:
...
$ cat web/.gitattributes
cat: web/.gitattributes: No such file or directory

Like I said, if this is a prestissimo issue I can submit it over there. Thanks.

@FlorentTorregrosa
Copy link
Contributor

Hi @datvance,

I have been able to reproduce the bug.

I tried to wrap the content of the method into a try / catch to see if we can react to an exception. But no exception got catched.

    try {
      foreach ($this->filenames as $sourceFilename => $filename) {
...
      } while ($multi->remain());
    }
    catch (\Exception $e) {
      $this->io->writeError($e->getMessage());
    }

So yeah maybe it is Prestissimo that does not handle errors correctly so we cannot react appropriately.

Maybe we can wait for comments from drupal-scaffold plugin maintainers.

@webflo
Copy link
Member

webflo commented Jul 4, 2018

@datvance @FlorentTorregrosa Please review #88

Thanks!

@FlorentTorregrosa
Copy link
Contributor

Testing.

@FlorentTorregrosa
Copy link
Contributor

OK with and without prestissimo. Errors got catched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants