Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const partialFailures = (resp.insertErrors || []).map((
insertError
) => {
return {
errors: insertError.errors.map((error) => {
return {
message: error.message,
reason: error.reason,
};
}),
row: rows[insertError.index],
};
});
if (partialFailures.length > 0) {
err = new util.PartialFailureError({
errors: partialFailures,
response: resp,
} as any);
}
callback(err, resp);
}
);