Przeglądaj źródła

Specific schema validation failure messages (fixes issue #1616)

Shane Auckland 12 lat temu
rodzic
commit
0ba335730e
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      src/Composer/Console/Application.php

+ 5 - 0
src/Composer/Console/Application.php

@@ -144,7 +144,12 @@ class Application extends BaseApplication
                     $this->io->write($e->getMessage());
                     exit(1);
                 }
+            } catch (JsonValidationException $e) {
+                $errors = ' - ' . implode(PHP_EOL . ' - ', $e->getErrors());
+                $message = $e->getMessage() . ':' . PHP_EOL . $errors;
+                throw new JsonValidationException($message);
             }
+
         }
 
         return $this->composer;