Skip to content

Commit

Permalink
fix(laravel): display the proper exception message
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Feb 2, 2022
1 parent cf89028 commit 875ac0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Exceptions/ManifestNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(
protected string $manifestPath,
protected ?string $configName = null
) {
$this->message = $this->hasConfigName()
$this->message = !$this->hasConfigName()
? "The manifest could not be found."
: "The manifest for the \"{$this->getConfigName()}\" configuration could not be found.";
}
Expand Down
4 changes: 2 additions & 2 deletions src/Exceptions/ViteException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ class ViteException extends \Exception
{
protected function hasConfigName(): bool
{
return property_exists($this, 'configName') && $this->configName !== 'default';
return $this->getConfigName() !== 'default';
}

protected function getConfigName(string $default = 'default'): string
{
if (property_exists($this, 'configName')) {
return $this->configName;
return $this->configName ?? $default;
}

return $default;
Expand Down

0 comments on commit 875ac0f

Please # to comment.