error to error_code