mirror of
https://github.com/dergigi/boris.git
synced 2025-12-28 12:04:31 +01:00
fix: resolve all linting issues - replace empty catch blocks and fix explicit any types
This commit is contained in:
@@ -333,7 +333,7 @@ function App() {
|
||||
try {
|
||||
const parsed = JSON.parse(content) as { method?: string; id?: unknown }
|
||||
method = parsed?.method
|
||||
} catch {}
|
||||
} catch (err) { console.warn('[bunker] failed to parse event content', err) }
|
||||
}
|
||||
const summary = {
|
||||
relays,
|
||||
@@ -344,7 +344,7 @@ function App() {
|
||||
contentLength: typeof content === 'string' ? content.length : undefined
|
||||
}
|
||||
console.log('[bunker] publish via signer:', summary)
|
||||
try { DebugBus.info('bunker', 'publish', summary) } catch {}
|
||||
try { DebugBus.info('bunker', 'publish', summary) } catch (err) { console.warn('[bunker] failed to log to DebugBus', err) }
|
||||
} catch (err) { console.warn('[bunker] failed to log publish summary', err) }
|
||||
return originalPublish(relays, event)
|
||||
}
|
||||
@@ -352,7 +352,7 @@ function App() {
|
||||
;(recreatedSigner as unknown as { subscriptionMethod: (relays: string[], filters: unknown[]) => unknown }).subscriptionMethod = (relays: string[], filters: unknown[]) => {
|
||||
try {
|
||||
console.log('[bunker] subscribe via signer:', { relays, filters })
|
||||
try { DebugBus.info('bunker', 'subscribe', { relays, filters }) } catch {}
|
||||
try { DebugBus.info('bunker', 'subscribe', { relays, filters }) } catch (err) { console.warn('[bunker] failed to log subscribe to DebugBus', err) }
|
||||
} catch (err) { console.warn('[bunker] failed to log subscribe summary', err) }
|
||||
return originalSubscribe(relays, filters)
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ const Debug: React.FC = () => {
|
||||
const doEncrypt = async (mode: 'nip44' | 'nip04') => {
|
||||
if (!signer || !pubkey) return
|
||||
try {
|
||||
const api = (signer as any)[mode]
|
||||
const api = (signer as { [key: string]: { encrypt: (pubkey: string, message: string) => Promise<string> } })[mode]
|
||||
DebugBus.info('debug', `encrypt start ${mode}`, { pubkey, len: payload.length })
|
||||
const start = performance.now()
|
||||
const cipher = await api.encrypt(pubkey, payload)
|
||||
@@ -61,7 +61,7 @@ const Debug: React.FC = () => {
|
||||
const doDecrypt = async (mode: 'nip44' | 'nip04') => {
|
||||
if (!signer || !pubkey) return
|
||||
try {
|
||||
const api = (signer as any)[mode]
|
||||
const api = (signer as { [key: string]: { decrypt: (pubkey: string, ciphertext: string) => Promise<string> } })[mode]
|
||||
const cipher = mode === 'nip44' ? cipher44 : cipher04
|
||||
if (!cipher) {
|
||||
DebugBus.warn('debug', `no cipher to decrypt for ${mode}`)
|
||||
|
||||
@@ -20,7 +20,7 @@ export const DebugBus = {
|
||||
buffer.push(entry)
|
||||
if (buffer.length > MAX_BUFFER) buffer.shift()
|
||||
listeners.forEach(l => {
|
||||
try { l(entry) } catch {}
|
||||
try { l(entry) } catch (err) { console.warn('[DebugBus] listener error:', err) }
|
||||
})
|
||||
},
|
||||
info(source: string, message: string, data?: unknown): void { this.log('info', source, message, data) },
|
||||
|
||||
Reference in New Issue
Block a user