C# – How to create a custom exception

To create a custom exception, create a subclass of the Exception class, like this: Then throw it just like you would any other exception, like this: It’s a good idea to pass in a custom error message to the base constructor. If this exception is unhandled, or if you are logging the exception, then it’ll … Read more

How to use toxiproxy to verify your code can handle timeouts and unavailable endpoints

When you have code that calls an endpoint, you need to make sure it’s resilient and can handle error scenarios, such as timeouts. One way to prove your code is resilient is by using toxiproxy to simulate bad behavior. Toxiproxy sits between your client code and the endpoint. It receives requests from your client, applies … Read more