Move DetectError to private