Game ideas & features

Your next feature

Crash Reporting

Capture a test error with context.

Unity
Illustration of Crash Reporting
Your visible result

A test error appears with context in the dashboard.

Triage a crash report2:53
Open video separately ↗

Prepare the same project

  1. Choose the same project in the dashboard as in your game configuration.

    Crash Reporting →
  2. No additional definition is needed for the first request. An empty result is valid until matching game data exists.

Build this feature

You can preview the guide. Running it requires an active project key. Prepare project

SDK installed and project configuration imported.

Save the C# file, attach it to a GameObject and enter Play. Check Console.

C#
Assets/Scripts/CrashReportingDemo.cs
horizOn callSetup
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using PM.horizOn.Cloud.Core;
5using PM.horizOn.Cloud.Manager;
6​
7// Attach this script to a GameObject in your first scene.
8public class CrashReportingDemo : MonoBehaviour
9{
10 async void Start()
11 {
12 // Setup: initialize, connect and sign in a player.
13 HorizonApp.Initialize();
14 await new HorizonServer().Connect();
15 if (!UserManager.Instance.IsSignedIn)
16 {
17 bool authenticated = UserManager.Instance.HasCachedAnonymousToken()
18 ? await UserManager.Instance.RestoreAnonymousSession()
19 : await UserManager.Instance.SignUpAnonymous("StatisticsPlayer");
20 if (!authenticated) return;
21 }
22​
23 // horizOn: capture crashes with breadcrumbs and context.
24 // Record a handled test error without crashing the editor.
25 CrashManager.Instance.StartCapture();
26 CrashManager.Instance.SetUserId(UserManager.Instance.CurrentUser.UserId);
27 CrashManager.Instance.RecordBreadcrumb("quickstart", "Handled test error");
28 try
29 {
30 throw new InvalidOperationException("horizOn Quickstart test error");
31 }
32 catch (InvalidOperationException exception)
33 {
34 CrashManager.Instance.RecordException(
35 exception,
36 new Dictionary<string, string> { ["source"] = "quickstart" });
37 }
38 Debug.Log("Test error submitted. Check Crash Reporting in the same project.");
39 }
40}
Open the complete SDK sample ↗

Test your new feature.

A test error appears with context in the dashboard.

Choose the same project in the dashboard as in your game configuration.

Endpoints
  • POST/crash-reports/session
  • POST/crash-reports/create
All endpoints in the API reference
Illustration of Leaderboards
Our suggestion for your next step

Give every round a high score.

Save the score after a round and show who's ahead. Keep using your connection and player session.

Tutorial video

Support and diagnosticsUnity5:14
Open video separately ↗