getMessage() . "\n"; echo "Error Code: " . $e->getErrorCode()->getValue() . "\n"; echo "Category: " . $e->getErrorCode()->getCategory() . "\n"; echo "Severity: " . $e->getErrorCode()->getSeverity()->value . "\n"; echo "Is Recoverable: " . ($e->getErrorCode()->isRecoverable() ? 'Yes' : 'No') . "\n"; echo "Recovery Hint: " . $e->getErrorCode()->getRecoveryHint() . "\n"; // Test ErrorHandler metadata creation echo "\nTesting ErrorHandler metadata generation...\n"; $response = $errorHandler->createHttpResponse($e); echo "HTTP Status Code would be: " . $response->status->value . "\n"; echo "Response created successfully!\n"; } echo "\n" . str_repeat('=', 60) . "\n\n"; // Test 2: Test with different error code that has Retry-After echo "Test 2: Testing with error code that has Retry-After\n"; echo str_repeat('-', 60) . "\n"; use App\Framework\Queue\Exceptions\ChainNotFoundException; try { throw ChainNotFoundException::byId('chain-123'); } catch (ChainNotFoundException $e) { echo "Exception: " . get_class($e) . "\n"; echo "Error Code: " . $e->getErrorCode()->getValue() . "\n"; echo "Retry After: " . ($e->getErrorCode()->getRetryAfterSeconds() ?? 'null') . " seconds\n"; $response = $errorHandler->createHttpResponse($e); echo "HTTP Status Code: " . $response->status->value . "\n"; echo "Response headers would include Retry-After if applicable\n"; } echo "\n✅ All ErrorHandler enhancement tests completed!\n";