(resourcePath, { allowNotFound = false } = {})
| 177 | }; |
| 178 | |
| 179 | const getResource = async (resourcePath, { allowNotFound = false } = {}) => { |
| 180 | try { |
| 181 | return await request(resourcePath); |
| 182 | } catch (error) { |
| 183 | if (allowNotFound && error.status === 404) return null; |
| 184 | throw error; |
| 185 | } |
| 186 | }; |
| 187 | |
| 188 | return { |
| 189 | host: formatHost(auth.host), |
no test coverage detected