2022-01-11 13:25:30 -05:00
|
|
|
<?php
|
2022-01-30 18:02:52 -05:00
|
|
|
namespace App\Helpers;
|
2022-01-11 13:25:30 -05:00
|
|
|
|
2022-02-05 18:58:30 -05:00
|
|
|
use App\Models\ErrorTemplate;
|
2022-05-24 08:10:41 -04:00
|
|
|
use TikScraper\Models\Meta;
|
2022-02-05 18:58:30 -05:00
|
|
|
|
2022-01-28 09:54:09 -05:00
|
|
|
class ErrorHandler {
|
2023-04-27 14:23:23 -04:00
|
|
|
public static function showMeta(Meta $meta) {
|
2022-01-28 09:54:09 -05:00
|
|
|
http_response_code($meta->http_code);
|
2022-11-04 15:08:19 -04:00
|
|
|
Wrappers::latte('error', new ErrorTemplate($meta->http_code, $meta->tiktok_msg, $meta->tiktok_code));
|
2022-09-03 08:01:03 -04:00
|
|
|
}
|
|
|
|
|
2023-04-27 14:23:23 -04:00
|
|
|
public static function showText(int $code, string $msg) {
|
2022-09-03 08:01:03 -04:00
|
|
|
http_response_code($code);
|
2022-11-04 15:08:19 -04:00
|
|
|
Wrappers::latte('error', new ErrorTemplate($code, $msg));
|
2022-01-11 13:25:30 -05:00
|
|
|
}
|
|
|
|
}
|