-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #696 from dolittle/tenant-specific-exception
Throw a friendlier exception when failing to resolve tenant specific …
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Source/DependencyInversion/Tenancy/FailedToResolveServiceForTenant.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) Dolittle. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using Dolittle.Runtime.Domain.Tenancy; | ||
|
||
namespace Dolittle.Runtime.DependencyInversion.Tenancy; | ||
|
||
/// <summary> | ||
/// Exception that gets thrown when autofac fails to resolve a tenant specific service. | ||
/// </summary> | ||
public class FailedToResolveServiceForTenant : Exception | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="FailedToResolveServiceForTenant"/> class. | ||
/// </summary> | ||
/// <param name="tenant">The tenant id it fails to resolve service for.</param> | ||
/// <param name="service">The service it fails to resolve.</param> | ||
/// <param name="resolutionException">The inner autofac resolution exception.</param> | ||
public FailedToResolveServiceForTenant(TenantId tenant, Type service, Exception resolutionException) | ||
: base($"Failed to resolve tenant specific service {service} for tenant {tenant}", resolutionException) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters