From 7599138c938c201e0430df298aedbd94d0f531e4 Mon Sep 17 00:00:00 2001 From: Sitaram Date: Tue, 19 Jul 2022 10:47:19 +0530 Subject: [PATCH] feat: Add intent and exception scenario for KeyNotFoundException --- at_commons/CHANGELOG.md | 3 +++ .../lib/src/exception/at_exceptions.dart | 19 +++++++++++++------ at_commons/pubspec.yaml | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/at_commons/CHANGELOG.md b/at_commons/CHANGELOG.md index 1053c340..a7b4f7a3 100644 --- a/at_commons/CHANGELOG.md +++ b/at_commons/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.0.20 +- Enhance notify verb to include the isEncrypted field +- Add intent and exception scenario to AtException sub-classes ## 3.0.19 - Rename byPassCache to bypassCache in lookup, plookup verb builders and at_constants ## 3.0.18 diff --git a/at_commons/lib/src/exception/at_exceptions.dart b/at_commons/lib/src/exception/at_exceptions.dart index 1f308201..7b9ab78e 100644 --- a/at_commons/lib/src/exception/at_exceptions.dart +++ b/at_commons/lib/src/exception/at_exceptions.dart @@ -1,5 +1,4 @@ -import 'package:at_commons/src/exception/at_exception_stack.dart'; -import 'package:at_commons/src/keystore/at_key.dart'; +import 'package:at_commons/at_commons.dart'; /// The class [AtException] and its subclasses represents various exceptions that can arise /// while using the @ protocol. @@ -40,7 +39,9 @@ class AtException implements Exception { /// The class [AtConnectException] and its subclasses represent any issues that prevents an connection to the root or the secondary server class AtConnectException extends AtException { - AtConnectException(message) : super(message); + AtConnectException(message, + {Intent? intent, ExceptionScenario? exceptionScenario}) + : super(message, intent: intent, exceptionScenario: exceptionScenario); } /// Exception thrown when there is an issue connecting to root server @@ -153,12 +154,16 @@ class InternalServerError extends AtException { /// Exception thrown when an atsign's secondary url cannot be reached or is unavailable /// Should this be extending AtConnectException? class SecondaryConnectException extends AtException { - SecondaryConnectException(message) : super(message); + SecondaryConnectException(message, + {Intent? intent, ExceptionScenario? exceptionScenario}) + : super(message, intent: intent, exceptionScenario: exceptionScenario); } /// Exception thrown when [AtKey.key] is not present in the keystore class KeyNotFoundException extends AtException { - KeyNotFoundException(message) : super(message); + KeyNotFoundException(message, + {Intent? intent, ExceptionScenario? exceptionScenario}) + : super(message, intent: intent, exceptionScenario: exceptionScenario); } /// Exception thrown when any parameter in a verb command is invalid @@ -168,7 +173,9 @@ class IllegalArgumentException extends AtException { /// Exception thrown when no response is received before the timeout duration class AtTimeoutException extends AtException { - AtTimeoutException(message) : super(message); + AtTimeoutException(message, + {Intent? intent, ExceptionScenario? exceptionScenario}) + : super(message, intent: intent, exceptionScenario: exceptionScenario); } /// Exception thrown when request to secondary server is invalid diff --git a/at_commons/pubspec.yaml b/at_commons/pubspec.yaml index b3fd97af..b8067732 100644 --- a/at_commons/pubspec.yaml +++ b/at_commons/pubspec.yaml @@ -1,6 +1,6 @@ name: at_commons description: A library of Dart and Flutter utility classes that are used across other components of the @‎platform. -version: 3.0.19 +version: 3.0.20 repository: https://github.com/atsign-foundation/at_tools homepage: https://atsign.dev