<?php

declare(strict_types=1);

namespace Drupal\flowdrop_memory\Exception;

/**
 * Exception thrown when a required memory key is not found.
 */
class MemoryKeyNotFoundException extends MemoryBackendException {

  /**
   * Constructs a MemoryKeyNotFoundException.
   *
   * @param string $scope
   *   The memory scope.
   * @param string $scope_id
   *   The scope identifier.
   * @param string $key
   *   The missing key.
   */
  public function __construct(string $scope, string $scope_id, string $key) {
    parent::__construct(
      sprintf("Memory key '%s' not found in scope '%s' (scope_id: '%s').", $key, $scope, $scope_id),
    );
  }

}
