Show debug info when TikTok gives error
This commit is contained in:
parent
3ba64be202
commit
a3b4143ab1
5 changed files with 20 additions and 10 deletions
|
|
@ -7,7 +7,7 @@ use TikScraper\Models\Meta;
|
|||
class ErrorHandler {
|
||||
public static function showMeta(Meta $meta) {
|
||||
http_response_code($meta->httpCode);
|
||||
Wrappers::latte('error', new ErrorTemplate($meta->httpCode, $meta->proxitokMsg, $meta->proxitokCode));
|
||||
Wrappers::latte('error', new ErrorTemplate($meta->httpCode, $meta->proxitokMsg, $meta->proxitokCode, $meta->response));
|
||||
}
|
||||
|
||||
public static function showText(int $code, string $msg) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,20 @@
|
|||
<?php
|
||||
namespace App\Models;
|
||||
use TikScraper\Models\Response;
|
||||
|
||||
class ErrorTemplate extends BaseTemplate {
|
||||
public int $http_code = 502;
|
||||
public ?int $tiktok_code = -1;
|
||||
public string $msg = '';
|
||||
|
||||
public ?Response $response = null;
|
||||
|
||||
function __construct(int $http_code, string $msg, ?int $tiktok_code = null) {
|
||||
|
||||
function __construct(int $http_code, string $msg, ?int $tiktok_code = null, ?Response $response) {
|
||||
parent::__construct('Error');
|
||||
$this->http_code = $http_code;
|
||||
$this->msg = $msg;
|
||||
$this->tiktok_code = $tiktok_code;
|
||||
$this->response = $response;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue