# Error detection and diagnosis The EC-Simulator API functions generally return [`EC_E_NOERROR`](error-codes_generic.html.md#c.EC_E_NOERROR) or an error code. Messages are logged as described in [`esInitSimulator()`](api_general.html.md#_CPPv415esInitSimulator10EC_T_DWORDPK25EC_T_SIMULATOR_INIT_PARMS). #### IMPORTANT Logging is typically done from within the JobTask context so the handler should queue the messages and process them in a low priority task. See logging in EcSimulatorHilDemo .