From 55ab5704d40016dfa4035bcecd689cbccd3a79ef Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Wed, 3 Aug 2016 09:38:15 +0200 Subject: [PATCH] Use a nicer URL for the error descriptions --- changelog/upgrade-notes.md | 2 +- doc/{errors.md => errors/index.md} | 0 src/ol/ol.js | 2 +- test/spec/ol/ol.test.js | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename doc/{errors.md => errors/index.md} (100%) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 8e5786a985..eb14528278 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -2,7 +2,7 @@ #### Changes in the way assertions are handled -Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors.html. There are additional console assertion checks when in debug mode when the new `ol.DEBUG` compiler flag (previously `goog.DEBUG`) is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.' +Previously, minified builds of the library did not have any assertions. This caused applications to fail silently or with cryptic stack traces. Starting with this release, developers get notified of many runtime errors through the new `ol.AssertionError`. This error has a `code` property. The meaning of the code can be found on http://openlayers.org/en/latest/doc/errors/. There are additional console assertion checks when in debug mode when the new `ol.DEBUG` compiler flag (previously `goog.DEBUG`) is `true`. As this is `true` by default, it is recommended that those creating custom builds set this to `false` so these assertions are stripped.' #### Removal of `ol.ENABLE_NAMED_COLORS` diff --git a/doc/errors.md b/doc/errors/index.md similarity index 100% rename from doc/errors.md rename to doc/errors/index.md diff --git a/src/ol/ol.js b/src/ol/ol.js index 36bafea837..69219efda2 100644 --- a/src/ol/ol.js +++ b/src/ol/ol.js @@ -329,7 +329,7 @@ ol.AssertionError = function(code) { */ this.message = 'Assertion failed. See ' + (ol.VERSION ? 'http://openlayers.org/en/' + ol.VERSION.split('-')[0] : '') + - '/doc/errors.html#' + code + ' for details.'; + '/doc/errors/#' + code + ' for details.'; /** * Error code. The meaning of the code can be found on diff --git a/test/spec/ol/ol.test.js b/test/spec/ol/ol.test.js index 55cc17f072..ebb8f50b68 100644 --- a/test/spec/ol/ol.test.js +++ b/test/spec/ol/ol.test.js @@ -13,13 +13,13 @@ describe('ol', function() { describe('ol.AssertionError', function() { it('generates a message', function() { var error = new ol.AssertionError(42); - expect(error.message).to.be('Assertion failed. See /doc/errors.html#42 for details.'); + expect(error.message).to.be('Assertion failed. See /doc/errors/#42 for details.'); }); it('generates a message with a versioned url', function() { var origVersion = ol.VERSION; ol.VERSION = 'foo'; var error = new ol.AssertionError(42); - expect(error.message).to.be('Assertion failed. See http://openlayers.org/en/foo/doc/errors.html#42 for details.'); + expect(error.message).to.be('Assertion failed. See http://openlayers.org/en/foo/doc/errors/#42 for details.'); ol.VERSION = origVersion; }); it('has an error code', function() {