From 0cbb076b9e3fd63e4357b0ed415c0d64c807e38b Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Thu, 28 Sep 2017 20:01:15 +0200 Subject: [PATCH] improve reported exceptions --- bin/rector.php | 7 ++++++- src/config/services.yml | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/rector.php b/bin/rector.php index 588f008a848..66e359e0827 100644 --- a/bin/rector.php +++ b/bin/rector.php @@ -33,6 +33,11 @@ try { exit($statusCode); } catch (Throwable $throwable) { $symfonyStyle = SymfonyStyleFactory::create(); - $symfonyStyle->error($throwable->getMessage()); + $symfonyStyle->error(sprintf( + '%s in %s on line %d', + $throwable->getMessage(), + $throwable->getFile(), + $throwable->getLine() + )); exit(1); } diff --git a/src/config/services.yml b/src/config/services.yml index 4b4495bd2ca..326a40af6b6 100644 --- a/src/config/services.yml +++ b/src/config/services.yml @@ -2,7 +2,6 @@ services: _defaults: autowire: true - # PSR-4 autodiscovery Rector\: resource: '../../src' exclude: '../../src/{Node/Attribute.php,Rector/Contrib}'