1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 04:30:31 +09:00

fix: set ENOTFOUND as available flag

This commit is contained in:
uetchy 2019-07-31 18:42:07 +09:00
parent f8196d0e80
commit afd9452e0d

View File

@ -22,7 +22,7 @@ module.exports = async (req, res) => {
res.json({ availability })
} catch (err) {
if (err.code === 'ENODATA') {
if (err.code === 'ENODATA' || err.code === 'ENOTFOUND') {
return res.status(200).json({ availability: true })
}
res.status(400).json({ error: err.message })