You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The handling of 400 level statusCodes via error callback or reject is not backward compatible after 9.0.1 (due to changes in axios somewhere around 0.21.1)
Expected Behavior
In the following code example, if a database does not exist when using nano 9.0.1 or earlier, exists would be true if missing_db does not exist:
{
message: 'error happened in your connection',
scope: 'socket',
errid: 'request'
}
Possible Solution
The following change to the config object corrects the issue, as a workaround:
const {db} = require('nano')({
url: 'http://some-db.server.com:5984/',
parseUrl: false,
requestDefaults: {
validateStatus: status => status < 500 // Resolve only if the status code is less than 500
}
})
Steps to Reproduce (for bugs)
Ensure missing_db does not exist
Execute the example code
Context
It is necessary to be able to know if a database exists or not
Your Environment
Version used: nano 9.0.5
Browser Name and version:
Operating System and version (desktop or mobile): node on MacOS
Link to your project:
The text was updated successfully, but these errors were encountered:
The handling of 400 level statusCodes via error callback or reject is not backward compatible after 9.0.1 (due to changes in axios somewhere around 0.21.1)
Expected Behavior
In the following code example, if a database does not exist when using nano 9.0.1 or earlier,
exists
would be true ifmissing_db
does not exist:Current Behavior
The above example code rejects with
err
as:Possible Solution
The following change to the config object corrects the issue, as a workaround:
Steps to Reproduce (for bugs)
missing_db
does not existContext
It is necessary to be able to know if a database exists or not
Your Environment
The text was updated successfully, but these errors were encountered: