Skip to content

Commit

Permalink
Less_Tree_Mixin_Call: Include mixin name in error message
Browse files Browse the repository at this point in the history
When a mixin call fails, debugging mixins can be a bit
painful when you don't know which one is erroring.

Change-Id: Ibd5a68f0449fbca5716147cff680368c8a564c81
  • Loading branch information
jrahmy authored and Krinkle committed Aug 1, 2023
1 parent d6478c5 commit 2155162
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Less/Tree/Mixin/Call.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public function compile( $env ) {
}

if ( $isOneFound ) {
throw new Less_Exception_Compiler( 'No matching definition was found for `' . $this->Format( $args ) . '`', null, $this->index, $this->currentFileInfo );
$selectorName = $this->selector->toCSS();
throw new Less_Exception_Compiler( 'No matching definition was found for ' . $selectorName . ' with args `' . $this->Format( $args ) . '`', null, $this->index, $this->currentFileInfo );

} else {
throw new Less_Exception_Compiler( trim( $this->selector->toCSS() ) . " is undefined in " . $this->currentFileInfo['filename'], null, $this->index );
Expand Down

0 comments on commit 2155162

Please sign in to comment.