--- generate_errors_orig.pl	2020-06-20 08:40:38.819060379 -0700
+++ generate_errors.pl	2020-06-20 08:47:26.511163591 -0700
@@ -162,16 +162,12 @@
 
     if ($error_name eq "MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE")
     {
-        ${$code_check} .= "${white_space}if( use_ret == -($error_name) )\n".
-                          "${white_space}\{\n".
-                          "${white_space}    mbedtls_snprintf( buf, buflen, \"$module_name - $description\" );\n".
-                          "${white_space}    return;\n".
-                          "${white_space}}\n"
+        # no-op, this case is hard-coded in error.fmt
     }
     else
     {
-        ${$code_check} .= "${white_space}if( use_ret == -($error_name) )\n".
-                          "${white_space}    mbedtls_snprintf( buf, buflen, \"$module_name - $description\" );\n"
+         my $error_text = $error_name =~ s/^MBEDTLS_ERR_//r;
+         ${$code_check} .= "${white_space}{ -($error_name), \"$error_text\" },\n"
     }
 };
 
