Refactor statusFromErrorMessage
...to make jshint happy
This commit is contained in:
@@ -249,11 +249,9 @@ function statusFromErrorMessage(errMsg) {
|
||||
else if (errMsg.match(/Postgis Plugin.*[\s|\n].*column.*does not exist/)) {
|
||||
statusCode = 400;
|
||||
}
|
||||
else if ( -1 !== errMsg.indexOf('does not exist') ) {
|
||||
else if ( -1 !== errMsg.indexOf('does not exist') && !errMsg.match(/function .* does not exist/ ) ) {
|
||||
if ( -1 !== errMsg.indexOf(' role ') ) {
|
||||
statusCode = 403; // role 'xxx' does not exist
|
||||
} else if ( errMsg.match(/function .* does not exist/) ) {
|
||||
statusCode = 400; // SQL error
|
||||
} else {
|
||||
statusCode = 404;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user