Skip to content

Commit

Permalink
Merge 41c4090 into fde97ed
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerbaptiste committed Apr 26, 2017
2 parents fde97ed + 41c4090 commit 5f58322
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Hydra/Serializer/ErrorNormalizer.php
Expand Up @@ -48,13 +48,11 @@ public function normalize($object, $format = null, array $context = [])
$trace = $object->getTrace();
}

$message = $this->getErrorMessage($object, $context, $this->debug);

$data = [
'@context' => $this->urlGenerator->generate('api_jsonld_context', ['shortName' => 'Error']),
'@type' => 'hydra:Error',
'hydra:title' => $context['title'] ?? 'An error occurred',
'hydra:description' => $message ?? (string) $object,
'hydra:description' => $this->getErrorMessage($object, $context, $this->debug),
];

if (isset($trace)) {
Expand Down
4 changes: 1 addition & 3 deletions src/Problem/Serializer/ErrorNormalizer.php
Expand Up @@ -45,12 +45,10 @@ public function normalize($object, $format = null, array $context = [])
$trace = $object->getTrace();
}

$message = $this->getErrorMessage($object, $context, $this->debug);

$data = [
'type' => $context['type'] ?? 'https://tools.ietf.org/html/rfc2616#section-10',
'title' => $context['title'] ?? 'An error occurred',
'detail' => $message ?? (string) $object,
'detail' => $this->getErrorMessage($object, $context, $this->debug),
];

if (isset($trace)) {
Expand Down

0 comments on commit 5f58322

Please sign in to comment.