DocsError TrackingHow It Works

How Error Tracking Works

Error tracking captures errors and helps you debug issues in production.


What It Captures

Errors

  • Custom errors you report
  • Exception messages with stack traces

Context

  • Error message
  • Stack trace (when provided)
  • Timestamp (ISO 8601 format)

Data Flow

┌─────────────┐       HTTP POST       ┌─────────────────┐
│   Your      │──────────────────────►│   Shard         │
│   Game      │  /api/monitor/report  │   Launcher      │
└─────────────┘                       └─────────────────┘
       │                                     │
       │ Fire-and-forget                     │ Aggregates
       │ (no blocking)                       │ error data
       ▼                                     ▼
┌─────────────┐                       ┌─────────────────┐
│   Game      │                       │   Error         │
│   Continues │                       │   Dashboard     │
└─────────────┘                       └─────────────────┘

Payload Structure

Every error report includes:

{
  "message": "Connection to server failed",
  "stackTrace": "at GameManager.Connect() line 42",
  "timestamp": "2024-01-15T10:30:00.000Z"
}
FieldTypeDescription
messagestringHuman-readable error message
stackTracestringStack trace (can be empty)
timestampstringISO 8601 timestamp

Silent Failure

All SDKs use fire-and-forget HTTP requests:

  • Errors are sent asynchronously
  • No blocking of game execution
  • If Launcher is unavailable, calls fail silently
  • No exceptions thrown to game code

Your game continues running normally even if the launcher is unavailable.


Best Practices

Report Meaningful Errors

# Good - specific and actionable
ShardSDK.monitor.report_error("Failed to load save file: corrupted header")
 
# Bad - too vague
ShardSDK.monitor.report_error("Error")

Include Stack Traces When Available

func _on_exception(message: String):
    var stack = get_stack()
    var stack_str = ""
    for frame in stack:
        stack_str += "%s:%d in %s\n" % [frame.source, frame.line, frame.function]
    ShardSDK.monitor.report_error(message, stack_str)

Network Considerations

  • HTTP timeout: 5 seconds
  • Failed requests are not retried
  • No local queuing of errors
  • Minimal performance impact on game