Skip to content

Commit b244e7c

Browse files
committed
change: Rename ProviderAlreadyBootedException to ContainerAlreadyBootedException
1 parent febd376 commit b244e7c

5 files changed

Lines changed: 9 additions & 10 deletions

File tree

packages/catalyst_builder_container/lib/src/service_container.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ServiceContainer implements ServiceProvider, ServiceRegistry {
9797
@override
9898
void boot() {
9999
if (_booted) {
100-
throw const ProviderAlreadyBootedException();
100+
throw const ContainerAlreadyBootedException();
101101
}
102102
_booted = true;
103103
for (var type in _preloadedTypes) {
@@ -169,7 +169,7 @@ class ServiceContainer implements ServiceProvider, ServiceRegistry {
169169
@override
170170
void applyPlugin(ServiceProviderPlugin plugin) {
171171
if (_booted) {
172-
throw const ProviderAlreadyBootedException();
172+
throw const ContainerAlreadyBootedException();
173173
}
174174
_appliedPlugins.add(plugin);
175175
_knownServices.addAll(plugin.provideKnownServices(this));

packages/catalyst_builder_container/test/service_container_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void main() {
2727
test('double boot should throw an exception', () {
2828
expect(
2929
() => serviceProvider.boot(),
30-
throwsA(const TypeMatcher<ProviderAlreadyBootedException>()),
30+
throwsA(const TypeMatcher<ContainerAlreadyBootedException>()),
3131
);
3232
});
3333

@@ -287,8 +287,7 @@ class _MySelfRegisteredService implements _SelfRegisteredService {
287287
class _ServiceWithTaggedDependencies {
288288
final List<Object> dependencies;
289289

290-
_ServiceWithTaggedDependencies(
291-
@Inject(tag: #tagToInject) List<Object> this.dependencies);
290+
_ServiceWithTaggedDependencies(@Inject(tag: #tagToInject) this.dependencies);
292291
}
293292

294293
class _PreloadService {

packages/catalyst_builder_contracts/lib/src/exception/provider_already_booted_exception.dart renamed to packages/catalyst_builder_contracts/lib/src/exception/container_already_booted_exception.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import 'catalyst_builder_exception.dart';
22

33
/// An exception that is thrown when boot is called on a
44
/// already booted ServiceProvider.
5-
class ProviderAlreadyBootedException extends CatalystBuilderException {
6-
/// Creates a new [ProviderAlreadyBootedException] object.
7-
const ProviderAlreadyBootedException()
5+
class ContainerAlreadyBootedException extends CatalystBuilderException {
6+
/// Creates a new [ContainerAlreadyBootedException] object.
7+
const ContainerAlreadyBootedException()
88
: super(
99
'The service provider was already booted.',
1010
);
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';
3-
export 'provider_already_booted_exception.dart';
3+
export 'container_already_booted_exception.dart';
44
export 'container_not_booted_exception.dart';
55
export 'service_not_found_exception.dart';

packages/catalyst_builder_contracts/test/unit/exception/provider_already_booted_exception_test.dart renamed to packages/catalyst_builder_contracts/test/unit/exception/container_already_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 ProviderAlreadyBootedException();
6+
var ex = const ContainerAlreadyBootedException();
77
expect(ex, const TypeMatcher<CatalystBuilderException>());
88
expect(ex.message, equals('The service provider was already booted.'));
99
});

0 commit comments

Comments
 (0)