-
-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added better exceptions to the service factory. (#1040)
- Loading branch information
1 parent
378ac50
commit 2d2ea3b
Showing
6 changed files
with
121 additions
and
12 deletions.
There are no files selected for viewing
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
1 change: 1 addition & 0 deletions
1
src/Core/Utilities.Tests/__snapshots__/ServiceFactoryTests.Cannot_Resolve_Dependencies.snap
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 @@ | ||
Unable to find a constructor on type `HotChocolate.Utilities.ServiceFactoryTests+ClassWithDependencies` that can be fulfilled with the currently available set of services. Check if all dependent services for this type are registered. |
1 change: 1 addition & 0 deletions
1
src/Core/Utilities.Tests/__snapshots__/ServiceFactoryTests.Catch_Exception_On_Create.snap
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 @@ | ||
Unable to create service `HotChocolate.Utilities.ServiceFactoryTests+ClassWithNoException` see inner exception for more details. |
1 change: 1 addition & 0 deletions
1
src/Core/Utilities.Tests/__snapshots__/ServiceFactoryTests.No_Services_Available.snap
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 @@ | ||
The instance type `HotChocolate.Utilities.ServiceFactoryTests+ClassWithDependencies` must have a parameterless constructor . |
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,25 @@ | ||
using System; | ||
|
||
namespace HotChocolate.Utilities | ||
{ | ||
#if !NETSTANDARD1_4 | ||
[Serializable] | ||
#endif | ||
public class CreateServiceException | ||
: Exception | ||
{ | ||
public CreateServiceException() | ||
{ | ||
} | ||
|
||
public CreateServiceException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public CreateServiceException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
} | ||
} | ||
} |
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