mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-09 23:15:41 -06:00
Improved error response in edit tag request
This commit is contained in:
parent
1da285a63a
commit
d7b18776f1
@ -64,7 +64,10 @@ class EditTagsAction extends AbstractRestAction
|
||||
$shortUrl = $this->shortUrlService->setTagsByShortCode($shortCode, $tags);
|
||||
return new JsonResponse(['tags' => $shortUrl->getTags()->toArray()]);
|
||||
} 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…
Reference in New Issue
Block a user