title: How to conditionally mock error responses with msw
body: <p>The UI I'm working on is rendered differently based on the response received. I would like to test the UI when a <code>4xx</code> and <code>5xx</code> responses are received.</p>
  <p>My api handler looks something like:</p>
  <pre><code>import { rest } from 'msw';
  import { items } from './apiValues';
  
  export const handlers = [
    rest.get('/items/', (_req, res, ctx) =&gt; res(ctx.status(200), ctx.json(items))),
  ];
  </code></pre>
  <p>This will always return a <code>2xx</code> response making it unable to test the UI if a <code>4xx</code> or <code>5xx</code> response is received, unless I change the handlers manually, which is tiring.</p>
  <p>How can tests for <code>4xx</code> and <code>5xx</code> responses be tested?</p>