Skip to content

Commit febd376

Browse files
committed
change: Rename ProviderNotBootedException to ContainerNotBootedException
1 parent 38d3c0d commit febd376

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

packages/catalyst_builder_container/lib/src/service_container.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class ServiceContainer implements ServiceProvider, ServiceRegistry {
107107

108108
void _ensureBoot() {
109109
if (_booted == false) {
110-
throw const ProviderNotBootedException();
110+
throw const ContainerNotBootedException();
111111
}
112112
}
113113

packages/catalyst_builder_container/test/service_container_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void main() {
2020
resetServiceProvider();
2121
expect(
2222
() => serviceProvider.resolve<String>(),
23-
throwsA(const TypeMatcher<ProviderNotBootedException>()),
23+
throwsA(const TypeMatcher<ContainerNotBootedException>()),
2424
);
2525
});
2626

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'catalyst_builder_exception.dart';
2+
3+
/// An exception that is thrown when resolving services on a not booted
4+
/// ServiceContainer.
5+
class ContainerNotBootedException extends CatalystBuilderException {
6+
/// Creates a new [ContainerNotBootedException] object.
7+
const ContainerNotBootedException()
8+
: super(
9+
'Service provider was not booted. Call ServiceContainer.boot() first.',
10+
);
11+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export 'catalyst_builder_exception.dart';
22
export 'dependency_not_found_exception.dart';
33
export 'provider_already_booted_exception.dart';
4-
export 'provider_not_booted_exception.dart';
4+
export 'container_not_booted_exception.dart';
55
export 'service_not_found_exception.dart';

packages/catalyst_builder_contracts/lib/src/exception/provider_not_booted_exception.dart

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/catalyst_builder_contracts/test/unit/exception/provider_not_booted_exception_test.dart renamed to packages/catalyst_builder_contracts/test/unit/exception/container_not_booted_exception_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:test/test.dart';
33

44
void main() {
55
test('constructor', () {
6-
var ex = const ProviderNotBootedException();
6+
var ex = const ContainerNotBootedException();
77
expect(ex, const TypeMatcher<CatalystBuilderException>());
88
expect(
99
ex.message,

0 commit comments

Comments
 (0)