mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Fix a few more type errors, whoops
This commit is contained in:
parent
b6e7a5529f
commit
ebce4a8b1d
3 changed files with 7 additions and 7 deletions
|
|
@ -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 })) {
|
for (const event of await store.query(filters, { limit: FILTER_LIMIT, timeout: Conf.db.timeouts.relay })) {
|
||||||
send(['EVENT', subId, event]);
|
send(['EVENT', subId, event]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
if (e instanceof RelayError) {
|
if (e instanceof RelayError) {
|
||||||
send(['CLOSED', subId, e.message]);
|
send(['CLOSED', subId, e.message]);
|
||||||
} else if (e.message.includes('timeout')) {
|
} else if (e.message.includes('timeout')) {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export class ConnectSigner implements NostrSigner {
|
||||||
const signer = await this.signer;
|
const signer = await this.signer;
|
||||||
try {
|
try {
|
||||||
return await signer.signEvent(event);
|
return await signer.signEvent(event);
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
if (e.name === 'AbortError') {
|
if (e.name === 'AbortError') {
|
||||||
throw new HTTPException(408, { message: 'The event was not signed quickly enough' });
|
throw new HTTPException(408, { message: 'The event was not signed quickly enough' });
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -44,7 +44,7 @@ export class ConnectSigner implements NostrSigner {
|
||||||
const signer = await this.signer;
|
const signer = await this.signer;
|
||||||
try {
|
try {
|
||||||
return await signer.nip04.encrypt(pubkey, plaintext);
|
return await signer.nip04.encrypt(pubkey, plaintext);
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
if (e.name === 'AbortError') {
|
if (e.name === 'AbortError') {
|
||||||
throw new HTTPException(408, {
|
throw new HTTPException(408, {
|
||||||
message: 'Text was not encrypted quickly enough',
|
message: 'Text was not encrypted quickly enough',
|
||||||
|
|
@ -59,7 +59,7 @@ export class ConnectSigner implements NostrSigner {
|
||||||
const signer = await this.signer;
|
const signer = await this.signer;
|
||||||
try {
|
try {
|
||||||
return await signer.nip04.decrypt(pubkey, ciphertext);
|
return await signer.nip04.decrypt(pubkey, ciphertext);
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
if (e.name === 'AbortError') {
|
if (e.name === 'AbortError') {
|
||||||
throw new HTTPException(408, {
|
throw new HTTPException(408, {
|
||||||
message: 'Text was not decrypted quickly enough',
|
message: 'Text was not decrypted quickly enough',
|
||||||
|
|
@ -76,7 +76,7 @@ export class ConnectSigner implements NostrSigner {
|
||||||
const signer = await this.signer;
|
const signer = await this.signer;
|
||||||
try {
|
try {
|
||||||
return await signer.nip44.encrypt(pubkey, plaintext);
|
return await signer.nip44.encrypt(pubkey, plaintext);
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
if (e.name === 'AbortError') {
|
if (e.name === 'AbortError') {
|
||||||
throw new HTTPException(408, {
|
throw new HTTPException(408, {
|
||||||
message: 'Text was not encrypted quickly enough',
|
message: 'Text was not encrypted quickly enough',
|
||||||
|
|
@ -91,7 +91,7 @@ export class ConnectSigner implements NostrSigner {
|
||||||
const signer = await this.signer;
|
const signer = await this.signer;
|
||||||
try {
|
try {
|
||||||
return await signer.nip44.decrypt(pubkey, ciphertext);
|
return await signer.nip44.decrypt(pubkey, ciphertext);
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
if (e.name === 'AbortError') {
|
if (e.name === 'AbortError') {
|
||||||
throw new HTTPException(408, {
|
throw new HTTPException(408, {
|
||||||
message: 'Text was not decrypted quickly enough',
|
message: 'Text was not decrypted quickly enough',
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ export async function updateTrendingTags(
|
||||||
|
|
||||||
await handleEvent(label, signal);
|
await handleEvent(label, signal);
|
||||||
console.info(`Trending ${l} updated.`);
|
console.info(`Trending ${l} updated.`);
|
||||||
} catch (e) {
|
} catch (e: any) {
|
||||||
console.error(`Error updating trending ${l}: ${e.message}`);
|
console.error(`Error updating trending ${l}: ${e.message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue