- Add comprehensive health check system with multiple endpoints - Add Prometheus metrics endpoint - Add production logging configurations (5 strategies) - Add complete deployment documentation suite: * QUICKSTART.md - 30-minute deployment guide * DEPLOYMENT_CHECKLIST.md - Printable verification checklist * DEPLOYMENT_WORKFLOW.md - Complete deployment lifecycle * PRODUCTION_DEPLOYMENT.md - Comprehensive technical reference * production-logging.md - Logging configuration guide * ANSIBLE_DEPLOYMENT.md - Infrastructure as Code automation * README.md - Navigation hub * DEPLOYMENT_SUMMARY.md - Executive summary - Add deployment scripts and automation - Add DEPLOYMENT_PLAN.md - Concrete plan for immediate deployment - Update README with production-ready features All production infrastructure is now complete and ready for deployment.
72 lines
1.7 KiB
PHP
72 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\LiveComponents\Exceptions;
|
|
|
|
use App\Framework\Exception\FrameworkException;
|
|
|
|
/**
|
|
* Exception thrown when state encryption/decryption fails
|
|
*
|
|
* Framework Principles:
|
|
* - Extends FrameworkException for consistent error handling
|
|
* - Readonly class with immutable properties
|
|
* - Factory methods for common error scenarios
|
|
* - No inheritance beyond FrameworkException
|
|
*/
|
|
final class StateEncryptionException extends FrameworkException
|
|
{
|
|
/**
|
|
* Encryption operation failed
|
|
*/
|
|
public static function encryptionFailed(
|
|
string $reason,
|
|
?\Throwable $previous = null
|
|
): self {
|
|
return self::simple(
|
|
message: "State encryption failed: {$reason}",
|
|
previous: $previous,
|
|
code: 500
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Decryption operation failed
|
|
*/
|
|
public static function decryptionFailed(
|
|
string $reason,
|
|
?\Throwable $previous = null
|
|
): self {
|
|
return self::simple(
|
|
message: "State decryption failed: {$reason}",
|
|
previous: $previous,
|
|
code: 500
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Encryption key is invalid or missing
|
|
*/
|
|
public static function invalidKey(string $reason): self
|
|
{
|
|
return self::simple(
|
|
message: "Invalid encryption key: {$reason}",
|
|
previous: null,
|
|
code: 500
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Data corruption detected
|
|
*/
|
|
public static function dataCorrupted(string $details): self
|
|
{
|
|
return self::simple(
|
|
message: "Encrypted state data is corrupted: {$details}",
|
|
previous: null,
|
|
code: 500
|
|
);
|
|
}
|
|
}
|