Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encryption exception handling #27

Open
selfmadecode opened this issue Dec 17, 2023 · 2 comments
Open

Encryption exception handling #27

selfmadecode opened this issue Dec 17, 2023 · 2 comments

Comments

@selfmadecode
Copy link
Owner

Implement robust error handling during encryption or decryption, including specific exceptions for different error scenarios, and provide meaningful error messages.

example:

try { // encryption or decryption algorithm here } catch (ArgumentNullException ex) { throw new ArgumentException("Invalid parameter. Ensure all parameters are not null.", ex); } catch (Exception ex) { throw new DecryptionException("Decryption failed. See inner exception for details.", ex); }

// catch IV key and secret key exception

`public class EncryptionException : Exception
{
public EncryptionException(string message, Exception innerException) : base(message, innerException)
{
}
}

public class DecryptionException : Exception
{
public DecryptionException(string message, Exception innerException) : base(message, innerException)
{
}
}`

@successJohn
Copy link
Collaborator

I would like to implement the encryption exception handling

@selfmadecode
Copy link
Owner Author

sure @successJohn you can take this👍, I will work on reviewing the async implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants