Nicer error display

This commit is contained in:
Pablo Ferreiro 2022-09-03 14:01:03 +02:00
parent 96fb2fd428
commit 38557fafa6
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
15 changed files with 53 additions and 32 deletions

View file

@ -1,13 +1,16 @@
<?php
namespace App\Models;
use TikScraper\Models\Meta;
class ErrorTemplate extends BaseTemplate {
public Meta $error;
public int $http_code = 502;
public ?int $tiktok_code = -1;
public string $msg = '';
function __construct(object $error) {
function __construct(int $http_code, string $msg, ?int $tiktok_code = null) {
parent::__construct('Error');
$this->error = $error;
$this->http_code = $http_code;
$this->msg = $msg;
$this->tiktok_code = $tiktok_code;
}
}