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) {
|
2023-09-27 07:24:27 -04:00
|
|
|
http_response_code($meta->httpCode);
|
2023-10-06 18:17:11 -04:00
|
|
|
Wrappers::latte('error', new ErrorTemplate($meta->httpCode, $meta->proxitokMsg, $meta->proxitokCode, $meta->response));
|
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
|
|
|
}
|
|
|
|
}
|