better error handling

This commit is contained in:
rusEfi 2018-01-02 13:07:05 -05:00
parent 7e3ccda4a1
commit 2021d910a8
1 changed files with 4 additions and 1 deletions

View File

@ -117,7 +117,10 @@ bool warning(obd_code_e code, const char *fmt, ...) {
#endif /* EFI_SIMULATOR */
#if EFI_SIMULATOR || EFI_PROD_CODE || defined(__DOXYGEN__)
efiAssert(isWarningStreamInitialized, "warn stream not initialized", false);
if (!isWarningStreamInitialized) {
firmwareError(CUSTOM_ERR_ASSERT, "warn stream not initialized for %d", code);
return false;
}
addWarningCode(code);
efitimesec_t now = getTimeNowSeconds();