SentryCrashUploader
- Module
- Http
- Header
#include "Http/SentryCrashUploader.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
int | FlushPending | Scan the crash dir for *.dmp, POST each (with its .txt sidecar) to the Sentry minidump endpoint, and delete on success. |
int | FlushPending | onlyBasePath (a report path without extension) limits the flush to that one report — what the reporter's Send button consents to. |
void | SetDsn | Provide the fallback DSN explicitly (overrides the compiled one) for reports that carry none. |
void | SetEngineDsnAllowed | A game host passes false: the compiled DSN is the engine's own project (editor and launchers), so a report of a game's that carries no DSN — one written before the game's settings were read — stays on disk rather than landing there. |
std::string | GetLastEndpoint | The minidump endpoint the last FlushPending() on THIS thread posted to (or would have, had it not been backing off). |
int32_t | GetLastWithheldCount | Reports the last FlushPending() on THIS thread left on disk because their game's settings did not allow sending them in that mode. |
bool | HasDsn | |
void | SetCrashDir | Override the scan dir (default <state root>/<Product>/Saved/Crashes). |
std::string | GetLastError | Human-readable reason the last FlushPending() on THIS thread failed to upload a report (HTTP status + server body, or the transport error). |
bool | AreRetriesSuppressed | True when the last FlushPending() on THIS thread stopped retrying the configured endpoint because its host has not resolved for several runs. |
FCrashUploadQueueStatus | GetQueueStatus | The queue in the crash dir against the endpoint reports without a DSN of their own go to. |
std::string | DescribeQueueStatus | One sentence for a person: how many reports wait and why, or empty when nothing is queued. |
Function details
FlushPending
static int FlushPending()Scan the crash dir for *.dmp, POST each (with its .txt sidecar) to the Sentry minidump endpoint, and delete on success. No-op (returns 0) if no DSN is configured or no dumps exist. Failed uploads are LEFT on disk for the next run, so it's safe to call when offline. DSN resolution, per report: the report_dsn line its .txt carries (the game's [CrashReportClient] Dsn), else explicit SetDsn(), else the DSN compiled into SentryCrashUploader.cpp (the engine's mowo-editor project). A report its game disabled or gave no DSN, or one mode may not send without asking, is left on disk. Returns the number of reports successfully uploaded. Synchronous, but the common case (no pending dumps) is just a cheap directory scan. Only does network I/O when a crash actually happened.
FlushPending
static int FlushPending(ECrashFlushMode mode, const std::string& onlyBasePath = std::string())onlyBasePath (a report path without extension) limits the flush to that one report — what the reporter's Send button consents to.
SetDsn
static void SetDsn(const std::string& dsn)Provide the fallback DSN explicitly (overrides the compiled one) for reports that carry none. Empty restores the compiled one.
SetEngineDsnAllowed
static void SetEngineDsnAllowed(bool allowed)A game host passes false: the compiled DSN is the engine's own project (editor and launchers), so a report of a game's that carries no DSN — one written before the game's settings were read — stays on disk rather than landing there.
GetLastEndpoint
static std::string GetLastEndpoint()The minidump endpoint the last FlushPending() on THIS thread posted to (or would have, had it not been backing off). Empty when it tried none.
GetLastWithheldCount
static int32_t GetLastWithheldCount()Reports the last FlushPending() on THIS thread left on disk because their game's settings did not allow sending them in that mode.
HasDsn
static bool HasDsn()SetCrashDir
static void SetCrashDir(const std::string& absDir)Override the scan dir (default <state root>/<Product>/Saved/Crashes).
GetLastError
static std::string GetLastError()Human-readable reason the last FlushPending() on THIS thread failed to upload a report (HTTP status + server body, or the transport error). Empty when every report went through.
AreRetriesSuppressed
static bool AreRetriesSuppressed()True when the last FlushPending() on THIS thread stopped retrying the configured endpoint because its host has not resolved for several runs. A UI that promises "retried on the next launch" must not say so then — nothing will be retried until the DSN is corrected or a day passes.
GetQueueStatus
static FCrashUploadQueueStatus GetQueueStatus()The queue in the crash dir against the endpoint reports without a DSN of their own go to. Reports stay queued until an upload succeeds.
DescribeQueueStatus
static std::string DescribeQueueStatus(const FCrashUploadQueueStatus& status)One sentence for a person: how many reports wait and why, or empty when nothing is queued.