Skip to content

Instantly share code, notes, and snippets.

@szyku
Last active June 10, 2019 09:39
Show Gist options
  • Save szyku/9cbcc884303187465eb046184ca159e7 to your computer and use it in GitHub Desktop.
Save szyku/9cbcc884303187465eb046184ca159e7 to your computer and use it in GitHub Desktop.
Better reason
<?php
if ($response->getStatusCode() >= 400) {
$code = $this->extractErrorCode($response->getBody());
switch ($code) {
case FailReasons::NO_TAGS:
$msg = 'The document has not enough signature tags';
break;
//...
default: $msg = $this->getBodyContentAsString($response->getBody());
}
throw new BadSigningRequest($msg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment