Refactor `expectApiResponse` into `createApiError` with explicit response checks (#16)
Replace `expectApiResponse` with `createApiError` for more explicit error handling across all API hooks.
Previously, `expectApiResponse` wrapped the entire fetch call in a try/catch, obscuring network errors under a generic fallback message and hiding the response from the caller. The new `createApiError` function accepts an already-resolved `Response` and returns a constructed `ApiError`, leaving the fetch call and `response.ok` check inline at each call site.
The error message construction has also been improved: if the response body contains an error message that differs from the fallback, both are combined as `"<fallback>: <response message>"` rather than discarding one in favor of the other.
authored by