def METHOD_NAME(self):
    error_handler = HTTPSourceErrorHandler()
    error_handler.add_handler(500, (255, 0, 0), cacheable=False)
    error_handler.add_handler(204, (255, 0, 127, 200), cacheable=True)
    self.source = TiledSource(self.grid, self.client, error_handler=error_handler)
    with mock_httpd(
        TEST_SERVER_ADDRESS,
        [
            (
                {"path": "/1/0/0.png"},
                {
                    "body": b"error",
                    "status": 500,
                    "headers": {"content-type": "text/plain"},
                },
            ),
            (
                {"path": "/1/0/0.png"},
                {
                    "body": b"error",
                    "status": 204,
                    "headers": {"content-type": "text/plain"},
                },
            ),
        ],
    ):
        resp = self.source.get_map(
            MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format="png")
        )
        assert not resp.cacheable
        assert resp.as_image().getcolors() == [((256 * 256), (255, 0, 0))]
        resp = self.source.get_map(
            MapQuery([-180, -90, 0, 90], (256, 256), SRS(4326), format="png")
        )
        assert resp.cacheable
        assert resp.as_image().getcolors() == [((256 * 256), (255, 0, 127, 200))]