Skip to content

Commit

Permalink
Merge pull request #69 from mdpoulter/patch-1
Browse files Browse the repository at this point in the history
Catch correct exception when fields are missing during decryption
  • Loading branch information
freekmurze authored Jul 18, 2024
2 parents 59f4f4b + af2ed76 commit 77b5cd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Observers/ModelObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Spatie\LaravelCipherSweet\Observers;

use ErrorException;
use ParagonIE\CipherSweet\Exception\EmptyFieldException;
use Spatie\LaravelCipherSweet\Contracts\CipherSweetEncrypted;

class ModelObserver
Expand All @@ -16,7 +16,7 @@ public function retrieved(CipherSweetEncrypted $model): void
{
try {
$model->decryptRow();
} catch (ErrorException) {
} catch (EmptyFieldException) {
// Not all fields are available to decrypt.
}
}
Expand Down

0 comments on commit 77b5cd8

Please sign in to comment.