proxitok/app/Helpers/ErrorHandler.php

18 lines
494 B
PHP
Raw Normal View History

<?php
2022-01-30 18:02:52 -05:00
namespace App\Helpers;
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 {
2022-09-03 08:01:03 -04:00
static public 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
}
static public function showText(int $code, string $msg) {
http_response_code($code);
2022-11-04 15:08:19 -04:00
Wrappers::latte('error', new ErrorTemplate($code, $msg));
}
}