1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 18:08:11 +09:00

chore: capitalize error message

This commit is contained in:
2019-12-10 18:33:39 +09:00
parent 5c4f9959f1
commit 8ecfb3919a
12 changed files with 46 additions and 26 deletions

View File

@@ -5,7 +5,7 @@ export default async function handler(req: NowRequest, res: NowResponse) {
const {query} = req.query;
if (!query) {
return sendError(res, new Error('no query given'));
return sendError(res, new Error('No query given'));
}
try {
@@ -13,6 +13,9 @@ export default async function handler(req: NowRequest, res: NowResponse) {
const availability = response[0].data.domainName ? false : true;
send(res, {availability});
} catch (err) {
if (err.code === 'ENOTFOUND') {
return send(res, {availability: true});
}
sendError(res, err);
}
}