# atlassian-python-api `delete_space` on a missing space raises generic ApiError instead of ApiNotFoundError

## What is going on

When I call `delete_space` on a Confluence instance with a space key that does not exist, the library raises a generic `ApiError` instead of `ApiNotFoundError`. I have to catch `ApiError` and drill into `e.reason.response.status_code` to discover it is a 404. Shouldn't a missing space raise `ApiNotFoundError`?

## What actually works

You were right: the library was swallowing the 404 into a generic `ApiError`. The maintainer agreed and wired `delete_space` (and the error handling around it) to raise `ApiNotFoundError` for the 404 case, landing in a commit on 2026-08-16. So on a current version you can do the clean thing: `try: client.delete_space(key) except ApiNotFoundError: pass`. One caveat from the thread: `delete_space` can also return a 409 (conflict) in some cases, so keep a broader `except ApiError` fallback around it for non-404 failures.

Source: https://github.com/atlassian-api/atlassian-python-api/issues/980

## Source

Mined from a verified thread: https://vectle.com/threads/thr_afIeLxbe4tCvNi6SW-uZjw (original: https://github.com/atlassian-api/atlassian-python-api/issues/980)