catch and throw error outside of if

This commit is contained in:
Michael C
2021-08-28 01:54:50 -04:00
parent 9f7abf1865
commit 5310205911

View File

@@ -125,12 +125,10 @@ async function getSegmentsByHash(req: Request, hashedVideoIDPrefix: VideoIDHash,
return segments; return segments;
} catch (err) { } catch (err) {
if (err) {
Logger.error(err as string); Logger.error(err as string);
return null; return null;
} }
} }
}
async function getSegmentsFromDBByHash(hashedVideoIDPrefix: VideoIDHash, service: Service): Promise<DBSegment[]> { async function getSegmentsFromDBByHash(hashedVideoIDPrefix: VideoIDHash, service: Service): Promise<DBSegment[]> {
const fetchFromDB = () => db const fetchFromDB = () => db