When there was no records that were found, dns:node throws an error. While we did handle it, there should have been an additional return statement to exit early rather than propagating into an error state.
Solution
If the error is of type ENODATA, return early with some default values instead.
Breaking Changes
[ ] Yes - this PR contains breaking changes
Details ...
[X] No - this PR is backwards compatible with ALL of the following feature flags in this doc
Tests
Locally enter these values into support/routes/v2/formsg/index.ts
formsgSiteLaunchRouter
.digAAAADomainRecords({
primaryDomainSource: "singaopreoae.sg",
} as SiteLaunchResult)
.then(console.log)
.catch(console.error)
formsgSiteLaunchRouter
.digCAADomainRecords({
primaryDomainSource: "singaopreoae.sg",
} as SiteLaunchResult)
.then(console.log)
.catch(console.error)
Problem
When there was no records that were found, dns:node throws an error. While we did handle it, there should have been an additional return statement to exit early rather than propagating into an error state.
Solution
If the error is of type
ENODATA
, return early with some default values instead.Breaking Changes
Tests
Locally enter these values into
support/routes/v2/formsg/index.ts
assert that the console log outputs
Deploy Notes
This fix is meant to go into prod line asap