How to Simulate HTTP Errors Using lueur
This guide will walk you through emulating application level HTTP errors into your application using lueur proxy capabilities.
Prerequisites
-
Install lueur
If you haven’t installed Lueur yet, follow the installation instructions.
-
Basic Proxy Setup Be familiar with running lueur run --with-[fault] commands from your terminal.
Constant Internal Server Error
-
Start the proxy with HTTP Error 500 from the remote server
lueur run \ --with-http-response \ # (1)! --http-response-status 500 \ # (2)! --http-response-trigger-probability 1 # (3)!
- Enable the HTTP error fault support
- Set the status to 500
- Set the error on all responses
Intermittent Service Unavailable Errors
-
Start the proxy with HTTP Error 503 from the remote server
lueur run \ --with-http-response \ # (1)! --http-response-status 503 \ # (2)! --http-response-trigger-probability 0.5 # (3)!
- Enable the HTTP error fault support
- Set the status to 503
- Set the error on half of the responses
Intermittent Not Found Errors
-
Start the proxy with HTTP Error 404 from the remote server
lueur \ --with-http-response \ # (1)! --http-response-status 404 \ # (2)! --http-response-trigger-probability 0.5 \ # (3)! --http-response-body '{"error": "true"}' # (4)!
- Enable the HTTP error fault support
- Set the status to 404
- Set the error on half of the responses
- Set a JSON response body