How to use the FORBIDDEN function from http-status-codes
Find comprehensive JavaScript http-status-codes.FORBIDDEN code examples handpicked from public code repositorys.
GitHub: TheFive/osmbc
199 200 201 202 203 204 205 206 207 208
if (index < 0 || index >= self[rc].length) return callback(new Error("Edit Review Comment, Index out of Range")); if (self[rc][index].user !== user.OSMUser) { const error = new Error(">" + user.OSMUser + "< is not allowed to change review"); error.status = HttpStatus.FORBIDDEN; return callback(error); } // nothing to change.
10
27
6
+ 5 other calls in file
http-status-codes.StatusCodes is the most popular function in http-status-codes (2750 examples)