diff --git a/src/util/route-utils.js b/src/util/route-utils.js index f297469..ba32ca1 100644 --- a/src/util/route-utils.js +++ b/src/util/route-utils.js @@ -156,7 +156,7 @@ class RouteUtils { // Handle 429 errors thrown by nginx if (err.error) { - // console.log('decodeError: err: ', err) + console.log('decodeError: err: ', err) if (err.error.includes('429 Too Many Requests')) { const internalMsg = diff --git a/test/v4/route-utils.js b/test/v4/route-utils.js new file mode 100644 index 0000000..ba25cfd --- /dev/null +++ b/test/v4/route-utils.js @@ -0,0 +1,34 @@ +/* + Unit tests for the route-utils.js library. +*/ + +const assert = require('chai').assert + +const RouteUtils = require('../../src/util/route-utils.js') + +describe('#route-utils', () => { + let uut + + beforeEach(() => { + uut = new RouteUtils() + }) + + describe('#decodeError', () => { + it('should decode a 429 error from nginx', () => { + const err = { + error: '\r\n