namespace System.Security.Cryptography { /// /// An exception class to wrap the errors returned by Daniel Dinu and Dmitry Khovratovich's Argon2 library. /// /// Except through very unusual conditions, the only exceptions which could be thrown from PasswordHasher /// are Argon2Exception, ArgumentNullException, DllNotFoundException (if libargon2.dll is not found) /// public class Argon2Exception : Exception { /// /// Construct an Argon2Exception with the specified Argon2 error code /// Which method the Argon2Exception originated from /// The error returned from the Argon2 library /// public Argon2Exception(string action, Argon2Error error) : base($"Error during Argon2 {action}: ({(int)error}) {error}") {} } }