I'm developing an add-in and I'm encountering an error.
A bunch of stuff is printed to the console, and some of it is:
What does that mean? How do I enable that setting?
Click File > Options, and then click Add-Ins. In the Manage list, click PowerPoint Add-ins, and then click Go. In the Available Add-Ins list, select the check box next to the add-in that you want to add, and then click Close.
To activate an Excel add-inClick the File tab, click Options, and then click the Add-Ins category. In the Manage box, click Excel Add-ins, and then click Go. The Add-Ins dialog box appears. In the Add-Ins available box, select the check box next to the add-in that you want to activate, and then click OK.
In Outlook, go to Tools > Options. On the Other tab, select Advanced Options. Select or clear the Enable logging (troubleshooting) check box. Exit and restart Outlook.
Great question!
Imagine you have code like this:
async function run() {
await Excel.run(async (context) => {
const range = context.workbook.getSelectedRange();
range.getRow(1000).format.fill.color = "yellow";
await context.sync();
});
}
And imagine that your selection is only a small range, such that getRow(1000)
will cause an exception.
If you run this today, you'll get some information:
But note that you don't get the full set of statements, only the "surrounding" ones (which, if you had a bunch of code, might not be enough). And also, that some of the information is "..."-ed out for you.
Now, stick the following line somewhere above your code:
OfficeExtension.config.extendedErrorLogging = true;
Once you have that, you'll get full error logging (which is great for debugging, but please don't do this in production apps -- you don't want to pay the performance cost, and more importantly, you don't want to log and store sensitive data, which might well be present in the log of the full statements (e.g., a 2D values array containing customer info...)
From the Office d.ts file on DefinitelyTyped:
/** Configuration */
var config: {
/**
* Determines whether to log additional error information upon failure.
*
* When this property is set to true, the error object will include a "debugInfo.fullStatements" property that lists all statements in the batch request, including all statements that precede and follow the point of failure.
*
* Setting this property to true will negatively impact performance and will log all statements in the batch request, including any statements that may contain potentially-sensitive data.
* It is recommended that you only set this property to true during debugging and that you never log the value of error.debugInfo.fullStatements to an external database or analytics service.
*/
extendedErrorLogging: boolean;
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With