add custom error_code support