Thrown when a stored column value cannot be decrypted: it was tampered with, moved from another column or entity, written with another key, or is not a ciphertext at all.
The message names the column context only; it never includes the stored value.
try { await repo.findOneBy({ id: 1 });} catch (err) { if (err instanceof FieldDecryptionError) { console.error(`cannot decrypt ${err.context}`); }} Copy
try { await repo.findOneBy({ id: 1 });} catch (err) { if (err instanceof FieldDecryptionError) { console.error(`cannot decrypt ${err.context}`); }}
Create an error for the given column context.
Readonly
Column context (Entity.property) the value was read for.
Entity.property
Thrown when a stored column value cannot be decrypted: it was tampered with, moved from another column or entity, written with another key, or is not a ciphertext at all.
The message names the column context only; it never includes the stored value.
Example