How to know if AP.confluence.getContentProperty has failed?

Hi, is there a way to detect getContentProperty failure? I am using getContentProperty inside a Promise and I want to reject the Promise when getContentProperty fails.

const customFunction = () => new Promise((resolve, reject) => {
  AP.confluence.getContentProperty(key, contentProperty => {
    // ...do other things
  });
});

setContentProperty has result.error to indicate failure but there is no equivalent for getContentProperty

Hi @BrigitteLeong,

Some JavaScript APIs support promises where you can add .catch() to handle errors, but is seems AP.confluence operations don’t support promises. I’ve created https://jira.atlassian.com/browse/CONFCLOUD-71211 to request this.

Regards,
Dugald

2 Likes

Thanks @dmorrow.