Skip to content

Commit 455d98d

Browse files
committed
improve display of errors
1 parent dc7c031 commit 455d98d

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

src/exceptions/FileDoesNotExistsException.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
class FileDoesNotExistsException extends Exception
88
{
9-
public function __construct(string $message, int $statusCode = 500)
9+
public function __construct(string $message, int $statusCode = 500, $previous = null)
1010
{
11-
parent::__construct($message, $statusCode);
11+
parent::__construct($message, $statusCode, $previous);
12+
}
13+
14+
public function __toString()
15+
{
16+
return __CLASS__ . ' : ' . $this->message;
1217
}
1318
}

src/exceptions/LanguageFileIsNotArrayException.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
class LanguageFileIsNotArrayException extends Exception
88
{
9-
public function __construct(string $message, int $statusCode = 500)
9+
public function __construct(string $message, int $statusCode = 500, $previous = null)
1010
{
11-
parent::__construct($message, $statusCode);
11+
parent::__construct($message, $statusCode, $previous);
12+
}
13+
14+
public function __toString()
15+
{
16+
return __CLASS__ . ' : ' . $this->message;
1217
}
1318
}

src/exceptions/UrlIsNotValidException.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66

77
class UrlIsNotValidException extends Exception
88
{
9-
public function __construct(string $message, int $statusCode = 500)
9+
public function __construct(string $message, int $statusCode = 500, $previous = null)
1010
{
11-
parent::__construct($message, $statusCode);
11+
parent::__construct($message, $statusCode, $previous);
12+
}
13+
14+
public function __toString()
15+
{
16+
return __CLASS__ . ' : ' . $this->message;
1217
}
1318
}

0 commit comments

Comments
 (0)