Skip to content

Report Errors from Your Game

This how-to adds error reporting to a LootLocker call in your game, so that when that call fails the failure shows up in the Web Console instead of only in the player's local log.

Error reports are not sent automatically. Check the response of an SDK call, and when it failed, report it along with a description of what your game was trying to do. That description becomes the user_description field on the report, and it's what makes a report readable later — prefer naming the action that failed over restating the error itself.

// Report the failure from inside the callback of the call that failed.
// The description is what you'll read in the Web Console, so name the action.
LootLockerSDKManager.GetProgression("player_level", (response) =>
{
if (!response.success)
{
response.ReportFailure("Failed to load the player's level progression", (reportResponse) =>
{
if (!reportResponse.success)
{
Debug.Log("Could not send the error report: " + reportResponse.errorData?.message);
}
});
return;
}
// Handle the successful response here.
});

See the Reference Documentation for the endpoints you're calling.

Add reporting where a failure would be hard to diagnose any other way: critical paths such as save file uploads, purchases, and authentication, and paths that are currently misbehaving in a live build. Those are the cases where you can't simply reproduce the problem on your own machine.

Don't report indiscriminately. Reporting every failure fills your 5,000-report budget with noise, and the oldest reports are dropped first once you hit it. Skip failures your game already handles as normal flow — a name that's already taken, or a purchase the player cancelled.

Your game now reports its failed LootLocker requests to the Web Console. See Find and Filter Error Reports to work through what comes in.