Add exception for missing composer.json file/document need for composer.json file
A project I worked on removed the composer.json as a security precaution, which in turn broke Drush. It turns out that this is because it uses drupal-finder to ascertain the Drupal root, which uses composer.json to figure that out. It would be handy to throw a specific exception for this instance, and to document it somewhere.
also throw for unparseable json.
+1 I happened to have a comma where there shouldn't be one. It took me several hours before I noticed after having reinstalled drush, drush-laucher and drupal-vm.
+1
Would also be nice to add an option to disable the check for the composer.json file.
In case it is not present, because it is not required for running Drupal. Why is this check needed? Wouldn't it be a possibility to just check the VERSION constant inside core/lib/Drupal.php instead?
+1 for this. I deployed a build artifact and obviously saw no need to include the composer.json. This makes drush not work since DrupalFinder requires a composer.json.
Yup this definitely makes sense and adds important debug information.