From a95cd837cdbf7c3a75015fda1276d859e563ac03 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Wed, 23 May 2018 21:53:53 -0400 Subject: [PATCH] improved logging --- backend/middlewares/SharingMWs.ts | 1 + backend/model/sql/SharingManager.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/middlewares/SharingMWs.ts b/backend/middlewares/SharingMWs.ts index f9d1637a..99099b68 100644 --- a/backend/middlewares/SharingMWs.ts +++ b/backend/middlewares/SharingMWs.ts @@ -69,6 +69,7 @@ export class SharingMWs { return next(); } catch (err) { + console.warn(err); return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'Error during creating sharing link', err)); } } diff --git a/backend/model/sql/SharingManager.ts b/backend/model/sql/SharingManager.ts index 62a53f19..f33f2c3e 100644 --- a/backend/model/sql/SharingManager.ts +++ b/backend/model/sql/SharingManager.ts @@ -4,12 +4,13 @@ import {SQLConnection} from './SQLConnection'; import {SharingEntity} from './enitites/SharingEntity'; import {Config} from '../../../common/config/private/Config'; import {PasswordHelper} from '../PasswordHelper'; +import {DeleteResult} from 'typeorm'; export class SharingManager implements ISharingManager { - private static async removeExpiredLink() { + private static async removeExpiredLink(): Promise { const connection = await SQLConnection.getConnection(); - return connection + return await connection .getRepository(SharingEntity) .createQueryBuilder('share') .where('expires < :now', {now: Date.now()})