Add simple ol.error function

This commit is contained in:
Tom Payne
2012-06-21 19:01:13 +02:00
parent 98495cafc3
commit 79f5339573

20
src/ol/error.js Normal file
View File

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