Skip to content

Commit

Permalink
Add section about injecting errors from client in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vortegatorres committed May 14, 2024
1 parent e12b3f5 commit f872576
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,16 @@ export QUICKPIZZA_DB="quickpizza.db"
If you want to run a test that uses [xk6-disruptor](https://k6.io/docs/javascript-api/xk6-disruptor/), or want to experiment with distributed tracing, you will need to deploy QuickPizza to Kubernetes.

For a detailed setup instructions, see the [QuickPizza Kubernetes guide](./docs/kubernetes-setup.md).

## Injecting Errors from Client

To introduce errors, utilize the header `x-Error`. Presently, the supported errors are as follows:

- **catalog-error-inserting**: This error triggers a 500 Internal error when attempting to insert a new pizza into the catalog.
- **catalog-timeout-inserting**: This error introduces a one-minute delay in the response, resulting in a timeout error.

Example of header usage:

```
curl -v -X POST localhost:3333/api/pizza -H "X-Error: catalog-timeout-inserting" -H "X-User-Id: 123" -d '{}'
```

0 comments on commit f872576

Please sign in to comment.