Enhance error logging and add `timeout` attribute