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.
Prerequisites
- Unity, Unreal, or Godot SDK installed and configured in your project.
- An active Player session (see Authentication).
Reporting a Failed Request
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.
// Report the failure from inside the delegate of the call that failed.// Pass the failed response through so the report keeps its status code and payload.LootLockerSDKManager::SendLootLockerErrorReport( TEXT("Failed to load the player's level progression"), FailedResponse, FLootLockerDefaultDelegate::CreateLambda([](bool bSuccess) { if (!bSuccess) { UE_LOG(LogTemp, Warning, TEXT("Could not send the error report")); } }));See the Reference Documentation for the endpoints you're calling.
Coming soon — this sample hasn't been written yet. In the meantime, refer to the Reference Documentation for this endpoint.
Coming soon — this sample hasn't been written yet. In the meantime, refer to the Reference Documentation for this endpoint.
Choosing What to Report
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.
Conclusion
Your game now reports its failed LootLocker requests to the Web Console. See Find and Filter Error Reports to work through what comes in.