EllanJiang/GameFramework · error · GameFrameworkException
Update interval is invalid.
Error message
Update interval is invalid.
What it means
DownloadCounter is the internal throughput counter of DownloadManager; its constructor requires both a positive update interval and record interval. This error means the update interval passed was <= 0, which would make the counter update every frame or never, breaking speed calculations.
Solutions
- Pass a positive updateInterval (e.g. 1f second) when creating DownloadManager/DownloadCounter
- Check serialized DownloadManager settings in the scene/asset are not 0
- Validate config parsing does not silently default intervals to 0
Example fix
// before m_DownloadManager = new DownloadManager(downloadCount, 0f, recordInterval); // after m_DownloadManager = new DownloadManager(downloadCount, 1f, recordInterval);
Defensive patterns
Strategy: validation
Validate before calling
if (updateInterval <= 0f) updateInterval = 1f; // floor before passing to DownloadManager
Type guard
bool IsValidInterval(float seconds) => !float.IsNaN(seconds) && seconds > 0f;
Try / catch
try { m_DownloadManager = new DownloadManager(...); } catch (GameFrameworkException ex) { Log.Error("Download manager config invalid: {0}", ex.Message); } Prevention
- Set non-zero defaults in DownloadManager Inspector settings
- Floor all parsed config intervals with Math.Max(1f, value)
- Reset-to-default on deserialization failure
When it happens
Trigger: Constructing DownloadCounter (or DownloadManager internally) with updateInterval <= 0f, e.g. passing 0, a negative float, or a config value that failed to parse.
Common situations: Download manager settings serialized as 0 in a Unity Inspector/scene, config file missing the interval key defaulting to 0, or float parsing returning 0 for a malformed value.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Record interval is invalid.
- Offset is invalid.
- Length is invalid.
- Delta length is invalid.
- Download agent helper is invalid.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/cfd8c155df8afbc4.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Download/DownloadManager.DownloadCounter.cs:25
namespace GameFramework.Download
{
internal sealed partial class DownloadManager : GameFrameworkModule, IDownloadManager
{
private sealed partial class DownloadCounter
{
private readonly GameFrameworkLinkedList<DownloadCounterNode> m_DownloadCounterNodes;
private float m_UpdateInterval;
private float m_RecordInterval;
private float m_CurrentSpeed;
private float m_Accumulator;
private float m_TimeLeft;
public DownloadCounter(float updateInterval, float recordInterval)
{
if (updateInterval <= 0f)
{
throw new GameFrameworkException("Update interval is invalid.");
}
if (recordInterval <= 0f)
{
throw new GameFrameworkException("Record interval is invalid.");
}
m_DownloadCounterNodes = new GameFrameworkLinkedList<DownloadCounterNode>();
m_UpdateInterval = updateInterval;
m_RecordInterval = recordInterval;
Reset();
}
public float UpdateInterval
{
get
{
return m_UpdateInterval;View on GitHub (pinned to d0c010b051)