Skip to content

Instantly share code, notes, and snippets.

@szyku
Last active June 10, 2019 09:39
Show Gist options
  • Save szyku/9a344fb9384e413c10b0f6212533ecf7 to your computer and use it in GitHub Desktop.
Save szyku/9a344fb9384e413c10b0f6212533ecf7 to your computer and use it in GitHub Desktop.
Better exception names
<?php
//....
$action = DocumentSigningAction::create($doc);
/** @var \Psr\Http\Message\ResponseInterface $response */
$response = $action->execute();
if ($response->getStatusCode() >= 500) {
throw new SigningServiceUnavailable();
}
if ($response->getStatusCode() >= 400) {
throw new BadSigningRequest();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment