Last active
February 16, 2024 05:55
-
-
Save katydorjee/12c334945d306a7743af1c1d3cc43bdb to your computer and use it in GitHub Desktop.
Logging SSJS errors on the client side.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat="server"> | |
var isDebug = true; | |
try { | |
var a = 1; | |
var b = "six"; | |
var result = 1 / b; | |
if(isDebug) | |
Write('<script>console.log("result: ' + result + '")</script>'); | |
} catch (ex) { | |
if(isDebug) | |
Write('<script>console.error("' + ex + '")</script>'); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment