OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
690 stars 95 forks source link

Excel for Mac: custom function errors stopped showing custom error hints #4813

Open wh1t3cAt1k opened 3 months ago

wh1t3cAt1k commented 3 months ago

Your Environment

Platform [PC desktop, Mac, iOS, Office on the web]: Mac

Steps to reproduce

Actual result:

When you hover over the (!) error box, a generic error message is shown:

image

Expected result:

The error should not be generic but should contain the custom error message like it used to before.

Link to live example(s)

ScriptLab snippet:

name: Issue with custom error message
description: >-
  On Mac (version 16.88 (24081116)), the error message reads "A value used in
  the formula is of the wrong data type" instead of the provided custom message.
host: EXCEL
api_set: {}
script:
  content: |
    /**
     * @customfunction
     */
    function returnValueError() {
      const error = new CustomFunctions.Error(CustomFunctions.ErrorCode.invalidValue, "Custom error message");

      return error;
    }
  language: typescript
libraries: |
  https://appsforoffice.microsoft.com/lib/1/hosted/office.js
  @types/office-js
  core-js@2.4.1/client/core.min.js

Context

Our users check these error hints to understand what they entered wrong in our functions.

Velixo internal tracking item

microsoft-github-policy-service[bot] commented 3 months ago

Thank you for letting us know about this issue. We will take a look shortly. Thanks.

shanshanzheng-dev commented 3 months ago

Hi @wh1t3cAt1k Thanks for reporting this issue. I can repro it. We'll investigate and report back if we have a suggestion for you. Thanks.