MCPcopy Create free account
hub / github.com/buggregator/server / loadExceptions

Function loadExceptions

modules/sentry/api_exceptions.go:280–323  ·  view source on GitHub ↗
(db *sql.DB, errorEventID string)

Source from the content-addressed store, hash-verified

278}
279
280func loadExceptions(db *sql.DB, errorEventID string) []map[string]any {
281 rows, err := db.Query(
282 `SELECT position, exception_type, exception_value, mechanism_type, handled, stacktrace
283 FROM sentry_exceptions WHERE error_event_id = ? ORDER BY position`, errorEventID,
284 )
285 if err != nil {
286 return []map[string]any{}
287 }
288 defer rows.Close()
289
290 var result []map[string]any
291 for rows.Next() {
292 var (
293 position int
294 excType sql.NullString
295 excValue sql.NullString
296 mechType sql.NullString
297 handled sql.NullBool
298 stacktraceStr sql.NullString
299 )
300 if err := rows.Scan(&position, &excType, &excValue, &mechType, &handled, &stacktraceStr); err != nil {
301 continue
302 }
303
304 var stacktrace any
305 if stacktraceStr.Valid {
306 json.Unmarshal([]byte(stacktraceStr.String), &stacktrace)
307 }
308
309 result = append(result, map[string]any{
310 "position": position,
311 "exception_type": scanNullString(excType),
312 "exception_value": scanNullString(excValue),
313 "mechanism_type": scanNullString(mechType),
314 "handled": scanNullBool(handled),
315 "stacktrace": stacktrace,
316 })
317 }
318
319 if result == nil {
320 result = []map[string]any{}
321 }
322 return result
323}
324
325func loadBreadcrumbs(db *sql.DB, errorEventID string) []map[string]any {
326 rows, err := db.Query(

Callers 1

handleExceptionDetailFunction · 0.85

Calls 3

scanNullStringFunction · 0.85
scanNullBoolFunction · 0.85
ScanMethod · 0.80

Tested by

no test coverage detected