Skip to content

Commit 4550b69

Browse files
JonathanCrdHarshaNallurujeremymeng
authored
Removing type validation for errors (Azure#19361)
* Removing type validation for errors * dummy commit * Revert "Removing type validation for errors" This reverts commit 0c6d019. * check for Error instance In min/max testing `instanceof RestError` failed. I suspect that the RestError type and the instance are from two different versions of core-http. Co-authored-by: Harsha Nalluru <[email protected]> Co-authored-by: Jeremy Meng <[email protected]>
1 parent 564a6d7 commit 4550b69

File tree

1 file changed

+3
-2
lines changed
  • sdk/appconfiguration/app-configuration/test/public/utils

1 file changed

+3
-2
lines changed

sdk/appconfiguration/app-configuration/test/public/utils/testHelpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ export async function assertThrowsRestError(
163163
await testFunction();
164164
assert.fail(`${message}: No error thrown`);
165165
} catch (err) {
166-
if (!(err instanceof RestError)) {
166+
if (!(err instanceof Error)) {
167167
throw new Error("Error is not recognized");
168168
}
169169
if (err.name === "RestError") {
170-
assert.equal(expectedStatusCode, err.statusCode, message);
170+
const restError = err as RestError;
171+
assert.equal(expectedStatusCode, restError.statusCode, message);
171172
return err;
172173
}
173174

0 commit comments

Comments
 (0)