[core] gc engine: merge error creation functions (code clarification)