// SPDX-FileCopyrightText: 2026 FocusFlow contributors
// SPDX-License-Identifier: AGPL-3.0-only

part of '../../encrypted_backup.dart';

/// Thrown when an encrypted backup cannot be decrypted with the passphrase.
final class BackupDecryptionException implements Exception {
  /// Creates a decryption failure with optional diagnostic [message].
  const BackupDecryptionException([
    this.message = 'Backup could not be decrypted.',
  ]);

  /// Diagnostic text for logs and tests.
  final String message;

  /// Converts scheduler data for `toString` without changing the source object.
  /// Conversion helpers keep persistence and export shapes explicit so domain models do not depend on storage-specific details.
  @override
  String toString() => 'BackupDecryptionException: $message';
}
