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; + } +};