Fix a few more type errors, whoops

This commit is contained in:
Alex Gleason 2024-09-22 17:46:21 -05:00
parent b6e7a5529f
commit ebce4a8b1d
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 7 additions and 7 deletions

View file

@ -104,7 +104,7 @@ function connectStream(socket: WebSocket, ip: string | undefined) {
for (const event of await store.query(filters, { limit: FILTER_LIMIT, timeout: Conf.db.timeouts.relay })) {
send(['EVENT', subId, event]);
}
} catch (e) {
} catch (e: any) {
if (e instanceof RelayError) {
send(['CLOSED', subId, e.message]);
} else if (e.message.includes('timeout')) {

View file

@ -30,7 +30,7 @@ export class ConnectSigner implements NostrSigner {
const signer = await this.signer;
try {
return await signer.signEvent(event);
} catch (e) {
} catch (e: any) {
if (e.name === 'AbortError') {
throw new HTTPException(408, { message: 'The event was not signed quickly enough' });
} else {
@ -44,7 +44,7 @@ export class ConnectSigner implements NostrSigner {
const signer = await this.signer;
try {
return await signer.nip04.encrypt(pubkey, plaintext);
} catch (e) {
} catch (e: any) {
if (e.name === 'AbortError') {
throw new HTTPException(408, {
message: 'Text was not encrypted quickly enough',
@ -59,7 +59,7 @@ export class ConnectSigner implements NostrSigner {
const signer = await this.signer;
try {
return await signer.nip04.decrypt(pubkey, ciphertext);
} catch (e) {
} catch (e: any) {
if (e.name === 'AbortError') {
throw new HTTPException(408, {
message: 'Text was not decrypted quickly enough',
@ -76,7 +76,7 @@ export class ConnectSigner implements NostrSigner {
const signer = await this.signer;
try {
return await signer.nip44.encrypt(pubkey, plaintext);
} catch (e) {
} catch (e: any) {
if (e.name === 'AbortError') {
throw new HTTPException(408, {
message: 'Text was not encrypted quickly enough',
@ -91,7 +91,7 @@ export class ConnectSigner implements NostrSigner {
const signer = await this.signer;
try {
return await signer.nip44.decrypt(pubkey, ciphertext);
} catch (e) {
} catch (e: any) {
if (e.name === 'AbortError') {
throw new HTTPException(408, {
message: 'Text was not decrypted quickly enough',

View file

@ -106,7 +106,7 @@ export async function updateTrendingTags(
await handleEvent(label, signal);
console.info(`Trending ${l} updated.`);
} catch (e) {
} catch (e: any) {
console.error(`Error updating trending ${l}: ${e.message}`);
}
}