[rs-commit] r29 - /rst-interop/trunk/src/site/resources/crypto.signText/signtext-form.js

rs-commit at redwax.eu rs-commit at redwax.eu
Sun Apr 17 00:11:35 CEST 2022


Author: minfrin at redwax.eu
Date: Sun Apr 17 00:11:33 2022
New Revision: 29

Log:
Add error handling.

Modified:
    rst-interop/trunk/src/site/resources/crypto.signText/signtext-form.js

Modified: rst-interop/trunk/src/site/resources/crypto.signText/signtext-form.js
==============================================================================
--- rst-interop/trunk/src/site/resources/crypto.signText/signtext-form.js	(original)
+++ rst-interop/trunk/src/site/resources/crypto.signText/signtext-form.js	Sun Apr 17 00:11:33 2022
@@ -3,7 +3,8 @@
 
 function signRequest(form) {
   if (crypto.signText) {
-    crypto.signText(form['tobesigned'].value).then(response => { form['signed'].value = response });
+    obj = crypto.signText(form['tobesigned'].value);
+    obj.then(response => { form['signed'].value = response }).catch(error => {alert(error)});
   }
   else {
     alert('An implementation of crypto.signText() is not installed in this browser.');



More information about the rs-commit mailing list