Paste number 84710: cajoler test case for exception types

Index of paste annotations: 1

Paste number 84710: cajoler test case for exception types
Pasted by: kpreid
When:2 years, 9 months ago
Share:Tweet this! | http://paste.lisp.org/+1TD2
Channel:#erights
Paste contents:
Raw Source | XML | Display As
<pre id="notice"></pre>
<script type="text/javascript">

try {
  throw new Error("aardvarks");
} catch (e) {
  document.getElementById("notice").appendChild(document.createTextNode(
    "Type: " + typeof(e) + " " + e.constructor.toString().split("\n")[0]
    + "\nPrint: " + e
    + "\nMessage: " + e.message
    + "\nName: " + e.name
    + "\n\n"))
}

try {
  try {
    throw new Error("baboons");
  } catch (e0) {
    if (false) {
      // ...
    } else {
      throw e0;
    }
  }
} catch (e) {
  document.getElementById("notice").appendChild(document.createTextNode(
    "Type: " + typeof(e) + " " +  e.constructor.toString().split("\n")[0]
    + "\nPrint: " + e
    + "\nMessage: " + e.message
    + "\nName: " + e.name))
}

</script>

Annotations for this paste:

Annotation number 1: In cajita mode I got
Pasted by: Mark Miller
When:2 years, 9 months ago
Share:Tweet this! | http://paste.lisp.org/+1TD2/1
Paste contents:
Raw Source | Display As
Type: object function Object() {
Print: [object Object]
Message: aardvarks
Name: Error

Type: string function String() {
Print: [object Object]
Message: undefined
Name: undefined

Colorize as:
Show Line Numbers
Index of paste annotations: 1

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.