Skip to content

empty-catch: core/src/exchanges/baozi/fetcher.ts:161 — market parse failure silently returns null #939

@realfishsam

Description

@realfishsam

Violation

        } catch {
            return null;
        }

Location

core/src/exchanges/baozi/fetcher.ts:161

Why It Matters

Any failure during Solana account deserialization (parseRaceMarket, discriminator check, etc.) is silently swallowed and returns null. A breaking change in the Baozi on-chain data layout, an RPC error, or a buffer parsing bug would be completely invisible. Callers see null and cannot distinguish a missing market from a broken decoder.

Suggested Fix

} catch (err) {
    logger.warn('BaoziFetcher: fetchRawSingleMarket failed', { pubkey: pubkey?.toBase58(), error: String(err) });
    return null;
}

Found by automated code hygiene audit

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions