office-addin-usage-data
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -248,3 +248,5 @@ "use strict"; | ||
getEventName() { | ||
return this.options.isForTesting ? `${this.options.projectName}-test` : this.options.projectName; | ||
return this.options.isForTesting | ||
? `${this.options.projectName}-test` | ||
: this.options.projectName; | ||
} | ||
@@ -310,3 +312,5 @@ /** | ||
} | ||
let error = err instanceof Error ? Object.create(err) : new Error(`${this.options.projectName} error: ${err}`); | ||
let error = err instanceof Error | ||
? Object.create(err) | ||
: new Error(`${this.options.projectName} error: ${err}`); | ||
error.name = this.getEventName(); | ||
@@ -336,3 +340,5 @@ let exceptionTelemetryObj = { | ||
reportExpectedException(method, err, data = {}) { | ||
let error = err instanceof Error ? Object.create(err) : new Error(`${this.options.projectName} error: ${err}`); | ||
let error = err instanceof Error | ||
? Object.create(err) | ||
: new Error(`${this.options.projectName} error: ${err}`); | ||
error.name = this.getEventName(); | ||
@@ -361,3 +367,5 @@ this.maskFilePaths(error); | ||
try { | ||
let error = err instanceof Error ? Object.create(err) : new Error(`${this.options.projectName} error: ${err}`); | ||
let error = err instanceof Error | ||
? Object.create(err) | ||
: new Error(`${this.options.projectName} error: ${err}`); | ||
error.name = this.getEventName(); | ||
@@ -364,0 +372,0 @@ let exceptionTelemetryObj = { |
{ | ||
"name": "office-addin-usage-data", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Provides infrastructure to send usage data events and exceptions.", | ||
@@ -34,6 +34,6 @@ "main": "./lib/main.js", | ||
"eslint": "^9.0.0", | ||
"eslint-plugin-office-addins": "^4.0.2", | ||
"eslint-plugin-office-addins": "^4.0.3", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"mocha": "^11.0.1", | ||
"office-addin-prettier-config": "^2.0.0", | ||
"office-addin-prettier-config": "^2.0.1", | ||
"rimraf": "^6.0.1", | ||
@@ -53,3 +53,3 @@ "sinon": "^19.0.2", | ||
"prettier": "office-addin-prettier-config", | ||
"gitHead": "05fbb226e1de4c8c0038dda07ef7e54c17ef74fd" | ||
"gitHead": "0a83e04842c872533d72b043ebc55e9a6013f34e" | ||
} |
@@ -199,3 +199,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
*/ | ||
public usageDataOptIn(testData: boolean = this.options.isForTesting, testResponse: string = ""): void { | ||
public usageDataOptIn( | ||
testData: boolean = this.options.isForTesting, | ||
testResponse: string = "" | ||
): void { | ||
try { | ||
@@ -254,3 +257,5 @@ let response: string = ""; | ||
private getEventName() { | ||
return this.options.isForTesting ? `${this.options.projectName}-test` : this.options.projectName; | ||
return this.options.isForTesting | ||
? `${this.options.projectName}-test` | ||
: this.options.projectName; | ||
} | ||
@@ -323,3 +328,6 @@ | ||
} | ||
let error = err instanceof Error ? Object.create(err) : new Error(`${this.options.projectName} error: ${err}`); | ||
let error = | ||
err instanceof Error | ||
? Object.create(err) | ||
: new Error(`${this.options.projectName} error: ${err}`); | ||
error.name = this.getEventName(); | ||
@@ -356,3 +364,6 @@ let exceptionTelemetryObj: appInsights.Contracts.ExceptionTelemetry = { | ||
public reportExpectedException(method: string, err: Error | string, data: object = {}) { | ||
let error = err instanceof Error ? Object.create(err) : new Error(`${this.options.projectName} error: ${err}`); | ||
let error = | ||
err instanceof Error | ||
? Object.create(err) | ||
: new Error(`${this.options.projectName} error: ${err}`); | ||
error.name = this.getEventName(); | ||
@@ -395,3 +406,6 @@ this.maskFilePaths(error); | ||
try { | ||
let error = err instanceof Error ? Object.create(err) : new Error(`${this.options.projectName} error: ${err}`); | ||
let error = | ||
err instanceof Error | ||
? Object.create(err) | ||
: new Error(`${this.options.projectName} error: ${err}`); | ||
error.name = this.getEventName(); | ||
@@ -398,0 +412,0 @@ let exceptionTelemetryObj: appInsights.Contracts.ExceptionTelemetry = { |
Sorry, the diff of this file is not supported yet
113833
2221