Enhance error reporting for envelope creation failure

Added detailed parameter information to the error message
in `InvalidOperationException` for better debugging context
when envelope creation fails.
This commit is contained in:
tekh 2025-06-26 11:56:49 +02:00
parent a1688608ab
commit 452077e86a

View File

@ -28,7 +28,7 @@ public class EnvelopeExecutor : SQLExecutor, IEnvelopeExecutor
var envelopes = await connection.QueryAsync<Envelope>(formattedSql);
var envelope = envelopes.FirstOrDefault()
?? throw new InvalidOperationException($"Envelope creation failed. Parameters:" +
$"userId={userId}, title='{title}', message='{message}', tfaEnabled={tfaEnabled}."); ;
$"userId={userId}, title='{title}', message='{message}', tfaEnabled={tfaEnabled}.");
envelope.User = await _userRepository.ReadByIdAsync(envelope.UserId);