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:
parent
f8196d0e80
commit
afd9452e0d
@ -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 })
|
||||
|
Loading…
x
Reference in New Issue
Block a user