From d4120d01c42edc16f935f5ef6513e980ec173232 Mon Sep 17 00:00:00 2001 From: Alin Eugen Deac Date: Sat, 13 Apr 2024 12:52:10 +0200 Subject: [PATCH] Add Service Provider Registrar related exception interfaces --- .../src/support/services/exceptions/BootException.ts | 9 +++++++++ .../support/services/exceptions/RegistrarException.ts | 9 +++++++++ .../support/services/exceptions/RegistrationException.ts | 9 +++++++++ .../contracts/src/support/services/exceptions/index.ts | 8 ++++++++ packages/contracts/src/support/services/index.ts | 4 +++- 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 packages/contracts/src/support/services/exceptions/BootException.ts create mode 100644 packages/contracts/src/support/services/exceptions/RegistrarException.ts create mode 100644 packages/contracts/src/support/services/exceptions/RegistrationException.ts create mode 100644 packages/contracts/src/support/services/exceptions/index.ts diff --git a/packages/contracts/src/support/services/exceptions/BootException.ts b/packages/contracts/src/support/services/exceptions/BootException.ts new file mode 100644 index 00000000..f8943acd --- /dev/null +++ b/packages/contracts/src/support/services/exceptions/BootException.ts @@ -0,0 +1,9 @@ +import RegistrarException from "./RegistrarException"; + +/** + * Service Provider Boot Exception + * + * To be thrown whenever a service provider is unable to boot, or fails during booting attempt. + */ +export default interface BootException extends RegistrarException +{} \ No newline at end of file diff --git a/packages/contracts/src/support/services/exceptions/RegistrarException.ts b/packages/contracts/src/support/services/exceptions/RegistrarException.ts new file mode 100644 index 00000000..1b517c2b --- /dev/null +++ b/packages/contracts/src/support/services/exceptions/RegistrarException.ts @@ -0,0 +1,9 @@ +import { Throwable } from "@aedart/contracts/support/exceptions"; + +/** + * Service Registrar Exception + * + * General exception to be thrown when unable to register, boot or resolve service providers + */ +export default interface RegistrarException extends Throwable +{} \ No newline at end of file diff --git a/packages/contracts/src/support/services/exceptions/RegistrationException.ts b/packages/contracts/src/support/services/exceptions/RegistrationException.ts new file mode 100644 index 00000000..73624345 --- /dev/null +++ b/packages/contracts/src/support/services/exceptions/RegistrationException.ts @@ -0,0 +1,9 @@ +import RegistrarException from "./RegistrarException"; + +/** + * Service Provider Registration Exception + * + * To be thrown when a service provider cannot be registered. + */ +export default interface RegistrationException extends RegistrarException +{} \ No newline at end of file diff --git a/packages/contracts/src/support/services/exceptions/index.ts b/packages/contracts/src/support/services/exceptions/index.ts new file mode 100644 index 00000000..db99ac2b --- /dev/null +++ b/packages/contracts/src/support/services/exceptions/index.ts @@ -0,0 +1,8 @@ +import BootException from "./BootException"; +import RegistrarException from "./RegistrarException"; +import RegistrationException from "./RegistrationException"; +export { + type BootException, + type RegistrarException, + type RegistrationException +} \ No newline at end of file diff --git a/packages/contracts/src/support/services/index.ts b/packages/contracts/src/support/services/index.ts index 9aaa8580..2e354da3 100644 --- a/packages/contracts/src/support/services/index.ts +++ b/packages/contracts/src/support/services/index.ts @@ -10,4 +10,6 @@ import ServiceProviderConstructor from "./ServiceProviderConstructor"; export { type ServiceProvider, type ServiceProviderConstructor, -} \ No newline at end of file +} + +export * from './exceptions/index'; \ No newline at end of file