[fix] Correctly emit error types