We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
voxpupuli
Learn more about funding links in repositories.
Report abuse
1 parent 621060e commit d1fcbc1Copy full SHA for d1fcbc1
templates/mongoshrc.js.erb
@@ -21,10 +21,12 @@ function authRequired() {
21
try {
22
return rs.status().ok != 1;
23
} catch (err) {
24
- if (err.message.match(/requires authentication/) || err.message.match(/not authorized on admin/)) {
25
- return true
26
- } else {
27
- throw("Unknown error :" + err)
+ $switch: {
+ branches: [
+ { case: err.message.match(/requires authentication/) || err.message.match(/not authorized on admin/), then: return true },
+ { case: err.message.match(/not running with --replSet/), then: return false },
28
+ ],
29
+ default: throw("Unknown error :" + err)
30
}
31
32
0 commit comments