"error",
"last"
],
+ "indent": [
+ "warn",
+ 2,
+ {
+ "SwitchCase": 1
+ }
+ ],
"sonarjs/cognitive-complexity": "warn",
"keyword-spacing": "error",
"linebreak-style": [
"strict": "error",
"vars-on-top": "error"
}
-}
\ No newline at end of file
+}
## [Unreleased]
-## [v1.1.0] -
+## [v1.1.0] - 2021-08-08
### Added
[Unreleased]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=HEAD;hp=v1.1.0
[v1.1.0]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=v1.1.0;hp=v1.0.0
-[v1.0.0]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=v1.0.0;hp=v0.0.0
\ No newline at end of file
+[v1.0.0]: https://git.squeep.com/?p=squeep-api-dingus;a=commitdiff;h=v1.0.0;hp=v0.0.0
default:
this.logger.error(_scope, 'unknown dingus error', { error: e });
handler = this.handlerInternalServerError.bind(this);
- }
+ }
} else if (e instanceof URIError) {
handler = this.handlerBadRequest.bind(this);
} else {
* @param {http.ServerResponse} res
* @param {object} ctx
*/
- async handlerBadRequest(req, res, ctx) {
+ async handlerBadRequest(req, res, ctx) {
this.setResponseType(this.responseTypes, req, res, ctx);
throw new ResponseError(Enum.ErrorResponse.BadRequest);
}
* @param {http.ServerResponse} res
* @param {object} ctx
*/
- async handlerInternalServerError(req, res, ctx) {
+ async handlerInternalServerError(req, res, ctx) {
this.setResponseType(this.responseTypes, req, res, ctx);
throw new ResponseError(Enum.ErrorResponse.InternalServerError);
}
'use strict';
const assert = require('assert');
-const sinon = require('sinon'); // eslint-disable-line node/no-unpublished-require
const apiDingus = require('..');
dingus.strictAccept = false;
dingus.setResponseType(['my/type'], req, res, ctx);
assert.strictEqual(ctx.responseType, 'my/type');
- });
+ });
}); // setResponseType