# wordpress-seo/28.5/src/exceptions/locking/lock-timeout-exception.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version 28.5. 22 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/28.5/code/src/exceptions/locking/lock-timeout-exception.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/28.5/raw/src/exceptions/locking/lock-timeout-exception.php
- Modified: 2026-05-12T12:03:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/28.5/code/src/exceptions/locking/lock-timeout-exception.php#L10-L20`.

```php
<?php

namespace Yoast\WP\SEO\Exceptions\Locking;

use RuntimeException;

/**
 * Exception for when a lock cannot be acquired within the allowed number of attempts.
 */
class Lock_Timeout_Exception extends RuntimeException {

	/**
	 * The constructor.
	 *
	 * @param string $lock_key The lock key that could not be acquired.
	 * @param int    $attempts The number of attempts made.
	 */
	public function __construct( string $lock_key, int $attempts ) {
		parent::__construct( "Failed to acquire lock '{$lock_key}' after {$attempts} attempts." );
	}
}

```
