proxitok/app/Helpers/ErrorHandler.php

18 lines
511 B
PHP
Raw Permalink 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 {
2023-04-27 14:23:23 -04:00
public static function showMeta(Meta $meta) {
http_response_code($meta->httpCode);
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));
}
}