1
0
mirror of https://github.com/snobu/destreamer.git synced 2026-02-10 16:49:42 +00:00

Created proper error logging (#55)

* changes in the evaluation of sessionInfo

* added Errors struct

* changed error handling if FFmpeg not present

* fixed error loggin thanks to the new Errors struct

* minor fix after changes in sanitizeUrls

* fix for succsesful execution and unknown code
This commit is contained in:
lukaarma
2020-04-11 10:27:48 +02:00
committed by GitHub
parent b5df2a83b1
commit d489b02d03
4 changed files with 58 additions and 46 deletions

View File

@@ -4,9 +4,32 @@ export type Session = {
ApiGatewayVersion: string;
}
export type Metadata = {
date: string;
title: string;
playbackUrl: string;
posterImage: string;
}
}
interface Errors {
[key: number]: string
}
// I didn't use an enum because there is no real advantage that i can find and
// we can't use multiline string for long errors
// TODO: create better errors descriptions
export const Errors: Errors = {
22: 'FFmpeg is missing. \n' +
'Destreamer requires a fairly recent release of FFmpeg to work properly. \n' +
'Please install it with your preferred package manager or copy FFmpeg binary in destreamer root directory. \n',
33: 'cannot split videoID from videUrl \n',
44: 'couldn\'t evaluate sessionInfo in the page \n',
55: 'running in an elevated shell \n',
66: 'no valid URL in the input \n'
}