lint: src/node/hooks/express/apicalls.js

pull/4667/head
John McLear 2021-01-21 21:06:52 +00:00 committed by Richard Hansen
parent fbc70c1276
commit 4de2844af2
1 changed files with 5 additions and 2 deletions

View File

@ -1,9 +1,11 @@
'use strict';
const log4js = require('log4js');
const clientLogger = log4js.getLogger('client');
const formidable = require('formidable');
const apiHandler = require('../../handler/APIHandler');
exports.expressCreateServer = function (hook_name, args, cb) {
exports.expressCreateServer = (hookName, args, cb) => {
// The Etherpad client side sends information about how a disconnect happened
args.app.post('/ep/pad/connection-diagnostic-info', (req, res) => {
new formidable.IncomingForm().parse(req, (err, fields, files) => {
@ -15,8 +17,9 @@ exports.expressCreateServer = function (hook_name, args, cb) {
// The Etherpad client side sends information about client side javscript errors
args.app.post('/jserror', (req, res) => {
new formidable.IncomingForm().parse(req, (err, fields, files) => {
let data;
try {
var data = JSON.parse(fields.errorInfo);
data = JSON.parse(fields.errorInfo);
} catch (e) {
return res.end();
}