Skip to content

Commit 737c394

Browse files
wazzacCopilot
andauthored
Update src/Traits/HasEncryptedAttributes.php
Co-authored-by: Copilot <[email protected]>
1 parent d78d9cc commit 737c394

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Traits/HasEncryptedAttributes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ public function saveEncryptedAttributes(): void
108108
}
109109
} catch (\Throwable $e) {
110110
// Log the error with context, but never log sensitive values
111-
Log::error('DB Encrypt: Failed to decrypt attributes for model ' . get_class($this) . ' (ID: ' . ($this->getKey() ?? 'n/a') . '): ' . $e->getMessage());
111+
Log::error('DB Encrypt: Failed to encrypt attributes for model ' . get_class($this) . ' (ID: ' . ($this->getKey() ?? 'n/a') . '): ' . $e->getMessage());
112112

113113
// Optionally, throw a custom exception for the application layer
114-
throw new \RuntimeException('Failed to decrypt encrypted attributes for this model. Please check the logs for details.', 0, $e);
114+
throw new \RuntimeException('Failed to encrypt attributes for this model. Please check the logs for details.', 0, $e);
115115
}
116116

117117
$this->_encryptedAttributesBuffer = [];

0 commit comments

Comments
 (0)