fix type errors caused by dependency updates
This commit is contained in:
parent
5234b92898
commit
681afb2d9f
6 changed files with 13 additions and 13 deletions
|
|
@ -73,7 +73,7 @@ export function validateSocketConnect(allowedPrivateNetworks: PrivateNetwork[] |
|
|||
|
||||
declare module 'node:http' {
|
||||
interface Agent {
|
||||
createConnection(options: net.NetConnectOpts, callback?: (err: unknown, stream: net.Socket) => void): net.Socket;
|
||||
createConnection(options: net.NetConnectOpts, callback?: (err: Error | null, stream: net.Socket) => void): net.Socket;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ class HttpRequestServiceAgent extends http.Agent {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
public createConnection(options: net.NetConnectOpts, callback?: (err: unknown, stream: net.Socket) => void): net.Socket {
|
||||
public createConnection(options: net.NetConnectOpts, callback?: (err: Error | null, stream: net.Socket) => void): net.Socket {
|
||||
const socket = super.createConnection(options, callback)
|
||||
.on('connect', () => {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
|
|
@ -106,7 +106,7 @@ class HttpsRequestServiceAgent extends https.Agent {
|
|||
}
|
||||
|
||||
@bindThis
|
||||
public createConnection(options: net.NetConnectOpts, callback?: (err: unknown, stream: net.Socket) => void): net.Socket {
|
||||
public createConnection(options: net.NetConnectOpts, callback?: (err: Error | null, stream: net.Socket) => void): net.Socket {
|
||||
const socket = super.createConnection(options, callback)
|
||||
.on('connect', () => {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
|
|
|
|||
|
|
@ -896,7 +896,7 @@ export class QueueService implements OnModuleInit {
|
|||
@bindThis
|
||||
public async queueRetryJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
||||
const queue = this.getQueue(queueType);
|
||||
const job: Bull.Job | null = await queue.getJob(jobId);
|
||||
const job: Bull.Job | undefined = await queue.getJob(jobId);
|
||||
if (job) {
|
||||
if (job.finishedOn != null) {
|
||||
await job.retry();
|
||||
|
|
@ -909,7 +909,7 @@ export class QueueService implements OnModuleInit {
|
|||
@bindThis
|
||||
public async queueRemoveJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
||||
const queue = this.getQueue(queueType);
|
||||
const job: Bull.Job | null = await queue.getJob(jobId);
|
||||
const job: Bull.Job | undefined = await queue.getJob(jobId);
|
||||
if (job) {
|
||||
await job.remove();
|
||||
}
|
||||
|
|
@ -943,7 +943,7 @@ export class QueueService implements OnModuleInit {
|
|||
@bindThis
|
||||
public async queueGetJob(queueType: typeof QUEUE_TYPES[number], jobId: string) {
|
||||
const queue = this.getQueue(queueType);
|
||||
const job: Bull.Job | null = await queue.getJob(jobId);
|
||||
const job: Bull.Job | undefined = await queue.getJob(jobId);
|
||||
if (job) {
|
||||
return this.packJobData(job);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ export function getErrorException(error: unknown): Error | null {
|
|||
}
|
||||
|
||||
// This is the inner exception, basically
|
||||
if (error.cause && !isAxiosError(error.cause)) {
|
||||
if (error.cause instanceof Error && !isAxiosError(error.cause)) {
|
||||
if (!error.cause.stack) {
|
||||
error.cause.stack = error.stack;
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ function unpackAxiosError(error: unknown): unknown {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
if (error.cause && !isAxiosError(error.cause)) {
|
||||
if (error.cause instanceof Error && !isAxiosError(error.cause)) {
|
||||
if (!error.cause.stack) {
|
||||
error.cause.stack = error.stack;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue