mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-28 20:41:41 +03:00
Improved error response in edit tag request
This commit is contained in:
parent
1da285a63a
commit
d7b18776f1
1 changed files with 4 additions and 1 deletions
|
@ -64,7 +64,10 @@ class EditTagsAction extends AbstractRestAction
|
||||||
$shortUrl = $this->shortUrlService->setTagsByShortCode($shortCode, $tags);
|
$shortUrl = $this->shortUrlService->setTagsByShortCode($shortCode, $tags);
|
||||||
return new JsonResponse(['tags' => $shortUrl->getTags()->toArray()]);
|
return new JsonResponse(['tags' => $shortUrl->getTags()->toArray()]);
|
||||||
} catch (InvalidShortCodeException $e) {
|
} catch (InvalidShortCodeException $e) {
|
||||||
return $out($request, $response->withStatus(404), 'Not found');
|
return new JsonResponse([
|
||||||
|
'error' => RestUtils::getRestErrorCodeFromException($e),
|
||||||
|
'message' => sprintf($this->translator->translate('No URL found for short code "%s"'), $shortCode),
|
||||||
|
], 404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue