website: improve error message on go.dev/play UI when server returns 413 while sharing snippet

The current error message handling on go.dev/play UI always displays same message for all http status codes other than 200.
Error handling mechanism on UI is updated to display "Snippet too large to share." when server responds with status code 413 while sharing a snippet.

Fixes golang/go#49527

Change-Id: Id7d617b7f363bc579b4d7e4be21e8443c44243e6
Reviewed-on: https://go-review.googlesource.com/c/website/+/366714
Reviewed-by: Russ Cox <rsc@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/_content/js/playground.js b/_content/js/playground.js
index 99c28c8..2095a59 100644
--- a/_content/js/playground.js
+++ b/_content/js/playground.js
@@ -489,6 +489,10 @@
       if (sharing) return;
       sharing = true;
 
+      var errorMessages = {
+        413: 'Snippet is too large to share.'
+      };
+
       var sharingData = body();
       $.ajax('/_/share', {
         processData: false,
@@ -498,7 +502,8 @@
         complete: function(xhr) {
           sharing = false;
           if (xhr.status != 200) {
-            alert('Server error; try again.');
+            var alertMsg = errorMessages[xhr.status] ? errorMessages[xhr.status] : 'Server error; try again.';
+            alert(alertMsg);
             return;
           }
           if (opts.shareRedirect) {