Skip to content

Commit

Permalink
Catch correct exception when fields are missing during decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
mdpoulter committed Jul 16, 2024
1 parent 59f4f4b commit af2ed76
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 af2ed76

Please sign in to comment.