Skip to content

Commit

Permalink
Revert logs and isolate
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm committed Nov 30, 2022
1 parent b728df1 commit 332f03b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("unavailable", () => {
baseUrl: "https://host.invalid",
});
const client = createPromiseClient(TestService, transport);
fit("should raise code unavailable", async function () {
it("should raise code unavailable", async function () {
try {
await client.unaryCall({});
fail("expected an error");
Expand Down
31 changes: 1 addition & 30 deletions packages/connect-node/src/private/connect-error-from-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,44 +40,15 @@ function isSyscallError(
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-explicit-any
const r = reason as any;
if (reason instanceof Error) {
// if ("code" in r) {
// // TODO
// // eslint-disable-next-line no-console
// console.error(r);
// // eslint-disable-next-line no-console
// console.error("want syscall", syscall, "want code", code);
// // eslint-disable-next-line no-console
// console.log("syscall in r", "syscall" in r)
// if ("syscall" in r) {
// // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,no-console
// console.log("r.syscall", r.syscall)
// }
// // eslint-disable-next-line no-console
// console.log("code in r", "code" in r)
// if ("code" in r) {
// // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,no-console
// console.log("r.code", r.code)
// }
// // eslint-disable-next-line no-console
// console.log("syscall = " + syscall, "syscall" in r)
// }
if ("code" in r && "syscall" in r) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
if (syscall === r.syscall && code === r.code) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access,no-console
console.log(`isSyscallError ${syscall} ${code} OK`, reason)
return true;
} else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access,no-console
console.log(`isSyscallError ${syscall} ${code} NO`, reason)
}
}
if ("cause" in reason) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return isSyscallError(r.cause, syscall, code);
} else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-member-access,no-console
console.log(`isSyscallError ${syscall} ${code} NO`, reason)
}
}
return false;
Expand Down

0 comments on commit 332f03b

Please sign in to comment.