I have a video file to probe with the use of FFPROBE, I'm trying to catch the error so that instead of just throwing the error it updates the DB row first, setting it to state 2 (processed 0 = default, processed 0 = done, processed 2 = error).
I've tried this first:
$user = Auth::user()->id;
$video = Video::find($videoUploaded->video->id);
$playlist = $video->playlist->id;
...
try {
//Line 39 $seconds
$seconds = $ffprobe->format(config('cf.video_disk') . "/$user/$playlist/$video->ts_name")->get('duration');
} catch (\Exeption $err) {
$video->processed = 2;
$video->name = $err->getMessage();
$video->url = $err->getMessage();
$video->update();
event(new VideoUpdated($video));
return $err->getMessage();
}
And also suppressing the error with @ and moving the DB update in the try:
try {
//Line 39 $seconds
$seconds = @$ffprobe->format(config('wondermark.video_disk') . "/$user/$playlist/$video->ts_name")->get('duration'); //Line 39
if (FALSE === $seconds) {
$video->processed = 2;
$video->name = $err->getMessage();
$video->url = $err->getMessage();
$video->update();
}
} catch (\Exeption $err) {
event(new VideoUpdated($video));
return $err->getMessage();
}
Both return the error on line #39 (see above comment) and the DB does not get updated :(