Skip to content
Tore Nestenius edited this page Oct 24, 2024 · 2 revisions

Error Handling and Testing Tool

Overview

This tool provides a set of endpoints that intentionally generate various HTTP errors and exceptions to test the application's error handling and logging capabilities. It is useful for developers and testers to verify the system's behavior when encountering different error conditions.

Purpose

The Error Handling and Testing Tool helps validate the application's response to common error scenarios such as 400 Bad Request, 500 Internal Server Error, 503 Service Unavailable, and unhandled exceptions. By utilizing this tool, developers can ensure that errors are properly logged and the application behaves as expected when encountering these errors.

How It Works

Error Simulation

The tool provides the following endpoints that simulate different error scenarios:

  • /Errors/Error400
    Responds with a 400 Bad Request status and logs the action.

  • /Errors/Error500
    Responds with a 500 Internal Server Error status and logs the action.

  • /Errors/Error503
    Responds with a 503 Service Unavailable status and logs the action.

  • /Errors/Exception
    Throws an unhandled InvalidOperationException, simulating a critical failure to test exception handling mechanisms.

Performance Testing

  • /Errors/SlowPage
    Simulates a slow-loading page by introducing a 5-second delay before returning a response. This is useful for testing timeouts and performance monitoring.

Additional Endpoint

  • /Errors/NotFound
    Attempts to access a non-existent page, generating a 404 Not Found error.
Clone this wiki locally