OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * This Source Code is subject to the terms of the Mozilla Public License |
| 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
| 4 * http://mozilla.org/MPL/2.0/. |
| 5 */ |
| 6 |
| 7 /** |
| 8 * @module debug |
| 9 */ |
| 10 |
| 11 /** |
| 12 * Reports an exception both to Browser Console and stdout. |
| 13 * |
| 14 * @param {Exception|Error} e |
| 15 */ |
| 16 exports.reportException = function(e) |
| 17 { |
| 18 let stack = ""; |
| 19 if (e && typeof e == "object" && "stack" in e) |
| 20 stack = e.stack + "\n"; |
| 21 |
| 22 Cu.reportError(e); |
| 23 dump(e + "\n" + stack + "\n"); |
| 24 } |
OLD | NEW |