feat: polish api error messages
This commit is contained in:
@@ -965,7 +965,7 @@ export function createRequestHandler() {
|
|||||||
if (!share) {
|
if (!share) {
|
||||||
res.statusCode = 400;
|
res.statusCode = 400;
|
||||||
res.setHeader("content-type", "application/json; charset=utf-8");
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
||||||
res.end(JSON.stringify({ error: "share parameter missing" }));
|
res.end(JSON.stringify({ error: "missing `share` parameter" }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1015,7 +1015,7 @@ export function createRequestHandler() {
|
|||||||
if (!target) {
|
if (!target) {
|
||||||
res.statusCode = 400;
|
res.statusCode = 400;
|
||||||
res.setHeader("content-type", "application/json; charset=utf-8");
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
||||||
res.end(JSON.stringify({ error: "url parameter missing" }));
|
res.end(JSON.stringify({ error: "missing `url` parameter" }));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user