bug 964: Also show error code in hex on IE keygen
authorMichael Tänzer <neo@nhng.de>
Tue, 24 Jul 2012 21:46:08 +0000 (23:46 +0200)
committerMichael Tänzer <neo@nhng.de>
Tue, 24 Jul 2012 21:46:08 +0000 (23:46 +0200)
Signed-off-by: Michael Tänzer <neo@nhng.de>
www/keygenIE.js

index fa4bce6..5dc0f13 100644 (file)
        }
        
        
+       /// Show error message to user from exception
+       var showError = function (message, exception) {
+               window.alert(message +
+                               "\n\nError: " + exception.message +
+                               " (" + exception.number.toString(16) + " / " +
+                               exception.number + ")");
+       }
+       
+       
+       
        // Get important elements from the DOM
        var form = document.getElementById("CertReqForm");
        var securityLevel = document.getElementById("SecurityLevel");
                                        csr.value = enroll.CreateRequest(0x1); //XCN_CRYPT_STRING_BASE64
                                        form.submit();
                                } catch (e) {
-                                       window.alert(createRequestErrorChooseAlgorithm.innerHTML + "\n\nError: " + e.message);
+                                       showError(createRequestErrorChooseAlgorithm.innerHTML, e);
                                }
                                
                                generatingKeyNotice.style.display = "none";
                                        csr.value = cenroll.createPKCS10("", "1.3.6.1.5.5.7.3.2");
                                        form.submit();
                                } catch (e) {
-                                       window.alert(createRequestError.innerHTML + "\n\nError: " + e.message + " (" + e.number + ")");
+                                       showError(createRequestError.innerHTML, e);
                                }
                                
                                generatingKeyNotice.style.display = "none";