ComposerInspector::validate() should throw ComposerNotReadyException instead of \Exception

Created on 27 February 2023, over 1 year ago
Updated 13 March 2023, over 1 year ago

Problem/Motivation

📌 Add a validate() method to ComposerInspector to ensure that Composer is usable Fixed added a new ComposerInspector::validate() method to ensure that Composer is usable in a given directory.

However, if it finds any problems, it throws \Exception. Just regular \Exception. That's really not useful at all to calling code.

Proposed resolution

Create a new exception for it to throw. Maybe call it ComposerNotReadyException, and give it additional data like:

  • The directory where Composer was run
  • If Composer was run but raised an exception (e.g., if composer --version raise an exception), the previous exception.
  • An individual list of messages that were raised, as an array.
📌 Task
Status

Fixed

Version

3.0

Component

Package Manager

Created by

🇺🇸United States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024