Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.2 KB

README.md

File metadata and controls

25 lines (20 loc) · 1.2 KB

Pact.Core 📦

Provides a collection of general purpose classes and extension methods.

Some examples follow:

var comp = new GenericEqualityComparer<Foo>(f => f.SortOrder);

In most circumstances you may not want an end-user to see the details of an internal exception. This exception type can be used in via a type-check to control when you do want to reveal that information. This is used internally by Pact.Web.ErrorHandling to decorate the resulting error page with the provided content, but the same principle can be applied elsewhere. Generally, it's not advisable to use exceptions for regular flow-control, but this provides an easy means of bubbling up useful information to the UI in circumstances where it is beneficial.

In Startup.cs ConfigureServices:

services.UsePactErrorHandling();

Then anywhere in your application code:

throw new FriendlyException("I may be an internal error, but I really want you to know something!");

For all of the extension methods, The API Wiki can be found here