Skip to content

Commit

Permalink
Merge branch 'develop' into 1.0-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpi committed Oct 31, 2022
2 parents d466934 + b7a6543 commit f8ec8b4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
15 changes: 15 additions & 0 deletions app/Exceptions/ManifestDoesNotExistException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace Pterodactyl\Exceptions;

use Exception;
use Spatie\Ignition\Contracts\Solution;
use Spatie\Ignition\Contracts\ProvidesSolution;

class ManifestDoesNotExistException extends Exception implements ProvidesSolution
{
public function getSolution(): Solution
{
return new Solutions\ManifestDoesNotExistSolution();
}
}
25 changes: 25 additions & 0 deletions app/Exceptions/Solutions/ManifestDoesNotExistSolution.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Pterodactyl\Exceptions\Solutions;

use Spatie\Ignition\Contracts\Solution;

class ManifestDoesNotExistSolution implements Solution
{
public function getSolutionTitle(): string
{
return "The manifest.json file hasn't been generated yet";
}

public function getSolutionDescription(): string
{
return 'Run yarn run build:production to build the frontend first.';
}

public function getDocumentationLinks(): array
{
return [
'Docs' => 'https://github.com/pterodactyl/panel/blob/develop/package.json',
];
}
}
8 changes: 7 additions & 1 deletion app/Services/Helpers/AssetHashService.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Support\Arr;
use Illuminate\Filesystem\FilesystemManager;
use Illuminate\Contracts\Filesystem\Filesystem;
use Pterodactyl\Exceptions\ManifestDoesNotExistException;

class AssetHashService
{
Expand Down Expand Up @@ -106,6 +107,11 @@ protected function manifest(): array
);
}

return static::$manifest;
$manifest = static::$manifest;
if ($manifest === null) {
throw new ManifestDoesNotExistException();
}

return $manifest;
}
}

0 comments on commit f8ec8b4

Please sign in to comment.