Skip to content

Commit

Permalink
Log caught errors
Browse files Browse the repository at this point in the history
  • Loading branch information
slifty committed Jul 26, 2023
1 parent f7128fc commit 040f784
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/classes/SftpSessionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export class SftpSessionHandler {
break;
}
}
}).catch(() => {
}).catch((err: unknown) => {
logger.debug(err);
this.openNewFileHandler(
reqId,
filePath,
Expand Down Expand Up @@ -195,14 +196,14 @@ export class SftpSessionHandler {
break;
}
})
.catch((reason: unknown) => {
.catch((err: unknown) => {
logger.warn('Failed to read data', {
reqId,
handle,
offset,
length,
});
logger.warn(reason);
logger.debug(err);
logger.verbose(
'Response: Status (FAILURE)',
{
Expand Down Expand Up @@ -383,7 +384,7 @@ export class SftpSessionHandler {
);
this.sftpConnection.status(reqId, SFTP_STATUS_CODE.OK);
}).catch((err) => {
logger.verbose(err);
logger.debug(err);
logger.verbose(
'Response: Status (FAILURE)',
{
Expand Down Expand Up @@ -545,7 +546,8 @@ export class SftpSessionHandler {
);
this.sftpConnection.status(reqId, SFTP_STATUS_CODE.OK);
})
.catch(() => {
.catch((err: unknown) => {
logger.debug(err);
logger.verbose(
'Response: Status (FAILURE)',
{
Expand Down Expand Up @@ -620,7 +622,8 @@ export class SftpSessionHandler {
);
this.sftpConnection.name(reqId, names);
})
.catch(() => {
.catch((err: unknown) => {
logger.debug(err);
logger.verbose(
'Response: Status (EOF)',
{
Expand Down Expand Up @@ -709,7 +712,8 @@ export class SftpSessionHandler {
});
this.sftpConnection.status(reqId, SFTP_STATUS_CODE.OK);
})
.catch(() => {
.catch((err: unknown) => {
logger.debug(err);
logger.verbose(
'Response: Status (FAILURE)',
{
Expand Down Expand Up @@ -777,7 +781,8 @@ export class SftpSessionHandler {
attrs,
);
})
.catch(() => {
.catch((err: unknown) => {
logger.debug(err);
logger.verbose(
'Response: Status (NO_SUCH_FILE)',
{
Expand Down Expand Up @@ -855,7 +860,8 @@ export class SftpSessionHandler {
break;
}
})
.catch(() => {
.catch((err: unknown) => {
logger.debug(err);
logger.verbose(
'Response: Status (FAILURE)',
{
Expand Down Expand Up @@ -944,7 +950,8 @@ export class SftpSessionHandler {
break;
}
})
.catch(() => {
.catch((err: unknown) => {
logger.debug(err);
logger.verbose(
'Response: Status (NO_SUCH_FILE)',
{
Expand Down

0 comments on commit 040f784

Please sign in to comment.