[theplatform] Improve error detection (#13222)