Add simple ol.error function
This commit is contained in:
20
src/ol/error.js
Normal file
20
src/ol/error.js
Normal 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;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user