Targets technical debts

parent 8b581eca
......@@ -58,7 +58,7 @@ class DumpCryptor {
encrypt(plainData, outputFile) {
if (!plainData) {
throw new Error('No data to encrypt specified - use --data=<plain-text>');
throw new Error('No data to encrypt specified - use --data=your-text');
}
if (!outputFile) {
const date = new Date();
......@@ -77,7 +77,7 @@ class DumpCryptor {
decrypt(inputFile, outputFile) {
if (!inputFile) {
throw new Error('No input file specified - use --input-file=<path-to-file>');
throw new Error('No input file specified - use --input-file=path-to-file');
}
if (!outputFile) {
outputFile = inputFile.replace('dump', 'decrypted_dump');
......
......@@ -96,17 +96,15 @@ if (process.argv.length < 2) {
return;
}
switch (argv.command) {
case 'buildServerInfoMail':
if (!argv.attachment || !argv.text) {
console.log(`> Command ${argv.command} requires missing parameter!`);
sendMail.help();
break;
}
sendMail.buildServerInfoMail(argv.attachment, argv.text, argv.header);
sendMail.send();
break;
default:
throw new Error(`No command handling specified for ${argv.command}`);
if (argv.command === 'buildServerInfoMail') {
if (!argv.attachment || !argv.text) {
console.log(`> Command ${argv.command} requires missing parameter!`);
sendMail.help();
return;
}
sendMail.buildServerInfoMail(argv.attachment, argv.text, argv.header);
sendMail.send();
} else {
throw new Error(`No command handling specified for ${argv.command}`);
}
}
......@@ -77,11 +77,7 @@ if (process.env.NODE_ENV === 'production') {
if (plainError) {
if (typeof plainError === 'string') {
try {
throw new Error(plainError);
} catch (e) {
plainError = e;
}
plainError = new Error(plainError);
}
error.type = plainError.constructor.name;
error.code = plainError.code;
......@@ -113,7 +109,7 @@ if (process.env.NODE_ENV === 'production') {
'--command=buildServerInfoMail',
`--attachment=${insecureDumpAsJson}`,
`--header=Arsnova.click Server Error Report (${error.type}: ${error.message})`,
`--text=${error.stack || JSON.stringify('<unknown> - no stack provided')}`,
`--text=${error.stack || JSON.stringify('unknown - no stack provided')}`,
];
const mailInstance = child_process.spawn(`node`, mailParams);
mailInstance.stderr.on('data', (data) => {
......
import * as Converter from 'api-spec-converter';
import { Request, Response } from 'express';
import { Response } from 'express';
import fileType from 'file-type';
import * as fs from 'fs';
import { OpenAPIObject } from 'openapi3-ts';
......@@ -11,9 +11,6 @@ import { settings, staticStatistics } from '../../statistics';
import { AbstractRouter } from './AbstractRouter';
declare global {
interface IUploadRequest extends Request {
busboy: any;
}
interface ICustomI18nResponse extends Response {
__mf: any;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment