glave-generate: Replace asserts with proper error detection and error logging.
authorPeter Lohrmann <peterl@valvesoftware.com>
Tue, 10 Mar 2015 22:30:36 +0000 (15:30 -0700)
committerPeter Lohrmann <peterl@valvesoftware.com>
Tue, 10 Mar 2015 22:36:41 +0000 (15:36 -0700)
commit7810957ada0c0d92a4c2952e7ec3daee178fa657
treed93e3e7826df1463136f0b45e2c914aa925ba9fd
parent6b0e08539b1af9e99f9bf8c7b68aeae778167944
glave-generate: Replace asserts with proper error detection and error logging.

* On Linux debug builds, the asserts cause the debugger to abort, but the code wasn't handling the error case safely anyway, so even a release build would likely crash.
* These situations were being hit if trying to load a trace file from an earlier header version, but are likely to be conditions we'll see when new developers start to use the API.
* With these changes, the error is properly reported and error return values propogated so that the UI detects the invalid file and reports an error to the user.
* The new glv_LogError(..) messages get printed to the console, but are not yet passed to the UI. This will be done as part of a larger change sometime in the future.
glave-generate.py