String comparison and regex to match errors instead of indexOf

This commit is contained in:
Raul Ochoa 2017-08-10 16:09:26 +02:00
parent 69eaa72819
commit e7c206762d

View File

@ -120,11 +120,11 @@ module.exports = function(serverOptions) {
onTileErrorStrategy = function onTileErrorStrategy$TimeoutTile(err, tile, headers, stats, format, callback) {
function isRenderTimeoutError (err) {
return err.message && (-1 !== err.message.indexOf('Render timed out'));
return err.message === 'Render timed out';
}
function isDatasourceTimeoutError (err) {
return err.message && (-1 !== err.message.indexOf('canceling statement due to statement timeout'));
return err.message && err.message.match(/canceling statement due to statement timeout/i);
}
function isTimeoutError (err) {