I have the following code:
const client = new DocumentProcessorServiceClient();
const inputConfig = {
mimeType: 'application/pdf',
gcsSource: {
uri: gcsSourceUri,
},
};
const outputConfig = {
gcsDestination: {
uri: gcsDestinationUri,
},
};
const name = `projects/myproject/locations/us/processors/myprocessor`;
const request = {
name,
inputConfigs: [inputConfig],
outputConfig: outputConfig
};
async function getText() {
const [operation] = await client.batchProcessDocuments(request);
};
getText();
Which produces the following error:
(node:72144) UnhandledPromiseRejectionWarning: Error: Failed to process all the documents
at Operation._unpackResponse (E:\development\audiobook\node_modules\google-gax\build\src\longRunningCalls\longrunning.js:136:31)
at E:\development\audiobook\node_modules\google-gax\build\src\longRunningCalls\longrunning.js:122:18
(node:72144) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:72144) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
What might be the problem here? The Cloud Storage URI is working and the file is in the correct format.