Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class DirectoryCreateException extends FrameworkException
|
||||
@@ -15,9 +16,10 @@ final class DirectoryCreateException extends FrameworkException
|
||||
) {
|
||||
parent::__construct(
|
||||
message: "Ordner '$directory' konnte nicht angelegt werden.",
|
||||
context: ExceptionContext::forOperation('directory_creation', 'Filesystem')
|
||||
->withData(['directory' => $directory]),
|
||||
code: $code,
|
||||
previous: $previous,
|
||||
context: ['directory' => $directory]
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class DirectoryListException extends FrameworkException
|
||||
@@ -15,9 +16,10 @@ final class DirectoryListException extends FrameworkException
|
||||
) {
|
||||
parent::__construct(
|
||||
message: "Fehler beim Auslesen des Verzeichnisses '$directory'.",
|
||||
context: ExceptionContext::forOperation('directory_listing', 'Filesystem')
|
||||
->withData(['directory' => $directory]),
|
||||
code: $code,
|
||||
previous: $previous,
|
||||
context: ['directory' => $directory]
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class FileCopyException extends FrameworkException
|
||||
@@ -16,12 +17,13 @@ final class FileCopyException extends FrameworkException
|
||||
) {
|
||||
parent::__construct(
|
||||
message: "Fehler beim Kopieren von '$source' nach '$destination'.",
|
||||
context: ExceptionContext::forOperation('file_copy', 'Filesystem')
|
||||
->withData([
|
||||
'source' => $source,
|
||||
'destination' => $destination,
|
||||
]),
|
||||
code: $code,
|
||||
previous: $previous,
|
||||
context: [
|
||||
'source' => $source,
|
||||
'destination' => $destination
|
||||
]
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class FileDeleteException extends FrameworkException
|
||||
@@ -15,9 +16,10 @@ final class FileDeleteException extends FrameworkException
|
||||
) {
|
||||
parent::__construct(
|
||||
message: "Fehler beim Löschen der Datei '$path'.",
|
||||
context: ExceptionContext::forOperation('file_delete', 'Filesystem')
|
||||
->withData(['path' => $path]),
|
||||
code: $code,
|
||||
previous: $previous,
|
||||
context: ['path' => $path]
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class FileMetadataException extends FrameworkException
|
||||
{
|
||||
public function __construct(string $path, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct("Konnte Metadaten für Datei '{$path}' nicht lesen", 0, $previous);
|
||||
parent::__construct(
|
||||
message: "Konnte Metadaten für Datei '{$path}' nicht lesen",
|
||||
context: ExceptionContext::forOperation('file_metadata', 'Filesystem')
|
||||
->withData(['path' => $path]),
|
||||
code: 0,
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class FileNotFoundException extends FrameworkException
|
||||
@@ -15,9 +16,10 @@ final class FileNotFoundException extends FrameworkException
|
||||
) {
|
||||
parent::__construct(
|
||||
message: "Datei '$path' nicht gefunden.",
|
||||
context: ExceptionContext::forOperation('file_read', 'Filesystem')
|
||||
->withData(['path' => $path]),
|
||||
code: $code,
|
||||
previous: $previous,
|
||||
context: ['path' => $path]
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class FilePermissionException extends FrameworkException
|
||||
{
|
||||
public function __construct(
|
||||
string $path,
|
||||
string $operation = 'access',
|
||||
?string $reason = null
|
||||
) {
|
||||
$message = "Permission denied for {$operation} on file: {$path}";
|
||||
|
||||
if ($reason) {
|
||||
$message .= " ({$reason})";
|
||||
}
|
||||
|
||||
$context = ExceptionContext::forOperation('file.permission', 'filesystem')
|
||||
->withData([
|
||||
'path' => $path,
|
||||
'operation' => $operation,
|
||||
'reason' => $reason,
|
||||
]);
|
||||
|
||||
parent::__construct($message, $context);
|
||||
}
|
||||
|
||||
public static function read(string $path, ?string $reason = null): self
|
||||
{
|
||||
return new self($path, 'read', $reason);
|
||||
}
|
||||
|
||||
public static function write(string $path, ?string $reason = null): self
|
||||
{
|
||||
return new self($path, 'write', $reason);
|
||||
}
|
||||
|
||||
public static function delete(string $path, ?string $reason = null): self
|
||||
{
|
||||
return new self($path, 'delete', $reason);
|
||||
}
|
||||
|
||||
public static function createDirectory(string $path, ?string $reason = null): self
|
||||
{
|
||||
return new self($path, 'create directory', $reason);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class FileReadException extends FrameworkException
|
||||
@@ -15,9 +16,10 @@ final class FileReadException extends FrameworkException
|
||||
) {
|
||||
parent::__construct(
|
||||
message: "Lesefehler bei '$path'.",
|
||||
context: ExceptionContext::forOperation('file_read', 'Filesystem')
|
||||
->withData(['path' => $path]),
|
||||
code: $code,
|
||||
previous: $previous,
|
||||
context: ['path' => $path]
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Filesystem\Exceptions;
|
||||
|
||||
use App\Framework\Exception\ExceptionContext;
|
||||
use App\Framework\Exception\FrameworkException;
|
||||
|
||||
final class FileWriteException extends FrameworkException
|
||||
@@ -15,9 +16,10 @@ final class FileWriteException extends FrameworkException
|
||||
) {
|
||||
parent::__construct(
|
||||
message: "Fehler beim Schreiben in '$path'.",
|
||||
context: ExceptionContext::forOperation('file_write', 'Filesystem')
|
||||
->withData(['path' => $path]),
|
||||
code: $code,
|
||||
previous: $previous,
|
||||
context: ['path' => $path]
|
||||
previous: $previous
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user