See the best posts from any Bluesky account
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Include underlying error detail in ClickHouseStore error messages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+25 -15
+25 -15
app/lib/clickhouse/store.ts
··· 182 182 query_params: queryParams, 183 183 }) 184 184 } catch (err) { 185 - throw new Error(`ClickHouseStore.getTopPosts failed for author ${query.authorDid}`, { 186 - cause: err, 187 - }) 185 + const detail = err instanceof Error ? err.message : String(err) 186 + throw new Error( 187 + `ClickHouseStore.getTopPosts failed for author ${query.authorDid}: ${detail}`, 188 + { cause: err }, 189 + ) 188 190 } 189 191 190 192 const rows = await resultSet.json<TopPostsRow>() ··· 222 224 query_params: { authorDid }, 223 225 }) 224 226 } catch (err) { 225 - throw new Error(`ClickHouseStore.getOldestPostDate failed for author ${authorDid}`, { 226 - cause: err, 227 - }) 227 + const detail = err instanceof Error ? err.message : String(err) 228 + throw new Error( 229 + `ClickHouseStore.getOldestPostDate failed for author ${authorDid}: ${detail}`, 230 + { cause: err }, 231 + ) 228 232 } 229 233 230 234 const rows = await resultSet.json<{ oldest: string }>() ··· 270 274 format: 'JSONEachRow', 271 275 }) 272 276 } catch (err) { 273 - throw new Error(`ClickHouseStore.insertPostSnapshots failed (${snapshots.length} rows)`, { 274 - cause: err, 275 - }) 277 + const detail = err instanceof Error ? err.message : String(err) 278 + throw new Error( 279 + `ClickHouseStore.insertPostSnapshots failed (${snapshots.length} rows): ${detail}`, 280 + { cause: err }, 281 + ) 276 282 } 277 283 } 278 284 ··· 303 309 format: 'JSONEachRow', 304 310 }) 305 311 } catch (err) { 306 - throw new Error(`ClickHouseStore.insertEngagementEvents failed (${events.length} rows)`, { 307 - cause: err, 308 - }) 312 + const detail = err instanceof Error ? err.message : String(err) 313 + throw new Error( 314 + `ClickHouseStore.insertEngagementEvents failed (${events.length} rows): ${detail}`, 315 + { cause: err }, 316 + ) 309 317 } 310 318 } 311 319 ··· 400 408 query_params: { authorDid }, 401 409 }) 402 410 } catch (err) { 403 - throw new Error(`ClickHouseStore.tombstoneUserSnapshots failed for author ${authorDid}`, { 404 - cause: err, 405 - }) 411 + const detail = err instanceof Error ? err.message : String(err) 412 + throw new Error( 413 + `ClickHouseStore.tombstoneUserSnapshots failed for author ${authorDid}: ${detail}`, 414 + { cause: err }, 415 + ) 406 416 } 407 417 } 408 418 }