(promise)
| 7 | * @returns {Promise} |
| 8 | */ |
| 9 | export async function rejectWhenEmptyArray(promise) { |
| 10 | const data = await promise; |
| 11 | if (!data || data.length === 0) { |
| 12 | throw new InternalError({ |
| 13 | message: 'Dados vazios retornados pelo provedor.', |
| 14 | name: 'EmptyProviderDataException', |
| 15 | }); |
| 16 | } |
| 17 | return data; |
| 18 | } |
nothing calls this directly
no outgoing calls
no test coverage detected