No error messages being thrown when using UXP functions

If the item you are calling returns a Promise, then make sure you have an “await” before the call.

Then at the end you can “then” it to get the errors:

await batchPlay(...).then(result => console.log(result), error => console.log(error));

This outputs both the results of the Promise and any errors in execution directly to the console.

This method works for any Promise, I think, even if the batchPlay is already inside try/catch. I’ve found the errors quite descriptive in helping resolve execution issues.

I use batchPlay almost exclusively instead of APIs, but if the API returns a Promise, I think this should work.

Just to be clear “app.open” is not a function. It needs the parentheses: app.open()

So maybe try:

// Show open file dialog
const document = await app.open().then(result => console.log(result), error => console.log(error));

and see what happens since app.open() returns a Promise.

I’m definitely not an expert in this, by maybe this thought process will help you figure it out.