MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / rejectWhenEmptyArray

Function rejectWhenEmptyArray

util/rejectWhenEmptyArray.js:9–18  ·  view source on GitHub ↗
(promise)

Source from the content-addressed store, hash-verified

7 * @returns {Promise}
8 */
9export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected