Skip to content

Commit

Permalink
"ssg": Improve error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
damiendart committed Jul 2, 2024
1 parent 6c5de8f commit b1979e4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/ssg/ssg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ declare(strict_types=1);

require_once __DIR__ . '/../../protected/vendor/autoload.php';

error_reporting(E_ALL | E_STRICT);
set_error_handler(
static function (
int $errorCode,
string $message,
string $file = 'UNKNOWN',
int $line = -1,
): bool {
if (($errorCode & error_reporting()) !== 0) {
throw new ErrorException($message, 0, $errorCode, $file, $line);
}

return false;
},
);

use StaticSiteGenerator\StaticSiteGenerator;

$application = new StaticSiteGenerator(
Expand Down

0 comments on commit b1979e4

Please sign in to comment.