Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom error handler #153

Merged
merged 10 commits into from
Nov 16, 2024
Merged

Conversation

Martin-Beranek
Copy link

No description provided.

@lulco
Copy link
Collaborator

lulco commented Sep 26, 2024

Toto bude asi cca ok, ale potrebujeme handlovat custom chyby z autorizatora a pripadne aj z param validácie. Nie som si istý ci som to do tasku napísal

src/Error/DefaultErrorHandler.php Outdated Show resolved Hide resolved
src/Error/DefaultErrorHandler.php Outdated Show resolved Hide resolved
src/Presenters/ApiPresenter.php Outdated Show resolved Hide resolved
/**
* @param array<mixed> $params
*/
public function handle(Throwable $error, array $params): JsonApiResponse;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tu mas error ale v default implementaci je exception. Zjednot to, pri named parametroch je toto neziaduci jav

src/Error/ErrorHandlerInterface.php Show resolved Hide resolved
$authorization = $api->getAuthorization();
$rateLimit = $api->getRateLimit();

$authResponse = $this->checkAuth($authorization);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preco sme presunuli autorizaciu az za parametre a rate limit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lebo treba spracovat parametre aby som mal dostupny Context do erroru. Nepacilo sa mi to ale lepsie som nevymyslel.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm už si spomínam. Len teraz úplne zmeníme výstupy - ak niečo predtým padlo už na autorizácii, alebo rate limite parametre sa vôbec neriešili. Teraz to bude naopak a neviem povedať ci korektne.

Copy link
Collaborator

@lulco lulco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no nic, skusme to mergnut, uvidime ci nas to nakope niekde do zadku

@lulco lulco merged commit d7c27bc into tomaj:4.0 Nov 16, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants