From 79f5339573b09c4bc2000eac4d447a67fcd51775 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 21 Jun 2012 19:01:13 +0200 Subject: [PATCH] Add simple ol.error function --- src/ol/error.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/ol/error.js diff --git a/src/ol/error.js b/src/ol/error.js new file mode 100644 index 0000000000..c81ecbe8cd --- /dev/null +++ b/src/ol/error.js @@ -0,0 +1,20 @@ +goog.provide('ol.error'); + + +/** + * @define + * @type {boolean} + */ +ol.error.VERBOSE_ERRORS = true; + + +/** + * @param {string} message Message. + */ +ol.error = function(message) { + if (ol.error.VERBOSE_ERRORS) { + throw new Error(message); + } else { + throw null; + } +};