fix: Throw a custom exception

This commit is contained in:
2022-08-03 16:44:18 +02:00
parent 8d222a160f
commit 45d0c57305
2 changed files with 8 additions and 2 deletions

View File

@@ -7,3 +7,9 @@ class InvalidSignatureException implements Exception {
class InvalidMessageHMACException implements Exception {
String errMsg() => 'The computed HMAC does not match the provided HMAC';
}
/// Triggered by the Double Ratchet if skipping messages would cause skipping more than
/// MAXSKIP messages
class SkippingTooManyMessagesException implements Exception {
String errMsg() => 'Skipping messages would cause a skip bigger than MAXSKIP';
}