({ response })
| 50 | */ |
| 51 | export const throwOnHttpError: Middleware = { |
| 52 | async onResponse({ response }) { |
| 53 | if (!response.ok) { |
| 54 | throw Object.assign( |
| 55 | new Error(`Bitbucket API ${response.status}: ${response.statusText}`), |
| 56 | { status: response.status }, |
| 57 | ); |
| 58 | } |
| 59 | }, |
| 60 | }; |
| 61 | |
| 62 | type CloudPaginatedResponse<T> = { |
nothing calls this directly
no outgoing calls
no test coverage detected