Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zork33 committed Sep 25, 2024
1 parent e3759c4 commit 544a9ee
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class YdbError extends Error {
throw new MissingStatus('Missing status!');
}

if (operation.issues) operation.issues = YdbError.flatIssues(operation.issues);
// if (operation.issues) operation.issues = YdbError.flatIssues(operation.issues);

const status = operation.status as unknown as StatusCode;
if (operation.status && !SUCCESS_CODES.has(status)) {
Expand All @@ -107,7 +107,8 @@ export class YdbError extends Error {
if (!ErrCls) {
throw new Error(`Unexpected status code ${status}!`);
} else {
throw new ErrCls(`${ErrCls.name} (code ${status}): ${YdbError.formatIssues(operation.issues)}`, operation.issues);
console.info(1000, JSON.stringify(operation, null, 2));
throw new ErrCls(`${ErrCls.name} (code ${status}): ${operation.issues}`, operation.issues);
}
}
}
Expand Down Expand Up @@ -284,8 +285,6 @@ export class TransportError extends YdbError {

static convertToYdbError(e: Error & GrpcStatusObject): Error {

console.info(1000, JSON.stringify(e, null, 2));

const ErrCls = TRANSPORT_ERROR_CODES.get(e.code);

if (!ErrCls) {
Expand Down
1 change: 0 additions & 1 deletion src/query/query-session-attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export async function attach(this:QuerySession, onStreamClosed: () => void) {
// delete this[attachStream]; // uncomment when reattach policy will be implemented
onStreamClosed();
} else {
console.info(2000, JSON.stringify(err, null, 2));
reject(TransportError.convertToYdbError(err));
}
});
Expand Down
1 change: 0 additions & 1 deletion src/query/query-session-execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ export function execute(this: QuerySession, opts: {
responseStream.on('error', (err: Error & GrpcStatusObject) => {
this.logger.trace('execute(): error: %o', err);
if (err.code === 1) return; // skip "cancelled" error
console.info(3000, JSON.stringify(err, null, 2));
cancel(TransportError.convertToYdbError(err), true);
});

Expand Down
1 change: 0 additions & 1 deletion src/retries_obsoleted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class RetryStrategy {
try {
return await asyncMethod();
} catch (e) {
console.info(4000, JSON.stringify(e, null, 2));
if(TransportError.isMember(e)) e = TransportError.convertToYdbError(e)
error = e;
if (e instanceof YdbError) {
Expand Down

0 comments on commit 544a9ee

Please sign in to comment.