Merge pull request #779 from woocommerce/pcp-864-fix-exception-note

Do not include full path in exception
This commit is contained in:
Emili Castells 2022-08-10 09:06:43 +02:00 committed by GitHub
commit 988ca57cf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,7 +118,7 @@ trait ProcessPaymentTrait {
* @return string
*/
protected function format_exception( Throwable $exception ): string {
$output = $exception->getMessage() . ' ' . $exception->getFile() . ':' . $exception->getLine();
$output = $exception->getMessage() . ' ' . basename( $exception->getFile() ) . ':' . $exception->getLine();
$prev = $exception->getPrevious();
if ( ! $prev ) {
return $output;