forked from svrjs/svrjs
Replace some ES5-style functions with ES6-style ones
This commit is contained in:
parent
12a4bcdc8a
commit
4506d38eac
2 changed files with 6 additions and 6 deletions
|
@ -183,7 +183,7 @@ function clientErrorHandler(err, socket) {
|
||||||
fs.access(
|
fs.access(
|
||||||
"." + errorCode.toString(),
|
"." + errorCode.toString(),
|
||||||
fs.constants.F_OK,
|
fs.constants.F_OK,
|
||||||
function (err) {
|
(err) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(errorCode.toString() + ".html");
|
callback(errorCode.toString() + ".html");
|
||||||
|
@ -207,7 +207,7 @@ function clientErrorHandler(err, socket) {
|
||||||
fs.access(
|
fs.access(
|
||||||
"." + errorCode.toString(),
|
"." + errorCode.toString(),
|
||||||
fs.constants.F_OK,
|
fs.constants.F_OK,
|
||||||
function (err) {
|
(err) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(errorCode.toString() + ".html");
|
callback(errorCode.toString() + ".html");
|
||||||
|
|
|
@ -343,8 +343,8 @@ function requestHandler(req, res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine error file
|
// Determine error file
|
||||||
function getErrorFileName(list, callback, _i) {
|
const getErrorFileName = (list, callback, _i) => {
|
||||||
function medCallback(p) {
|
const medCallback = (p) => {
|
||||||
if (p) callback(p);
|
if (p) callback(p);
|
||||||
else {
|
else {
|
||||||
if (errorCode == 404) {
|
if (errorCode == 404) {
|
||||||
|
@ -353,7 +353,7 @@ function requestHandler(req, res) {
|
||||||
fs.access(
|
fs.access(
|
||||||
"." + errorCode.toString(),
|
"." + errorCode.toString(),
|
||||||
fs.constants.F_OK,
|
fs.constants.F_OK,
|
||||||
function (err) {
|
(err) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(errorCode.toString() + ".html");
|
callback(errorCode.toString() + ".html");
|
||||||
|
@ -377,7 +377,7 @@ function requestHandler(req, res) {
|
||||||
fs.access(
|
fs.access(
|
||||||
"." + errorCode.toString(),
|
"." + errorCode.toString(),
|
||||||
fs.constants.F_OK,
|
fs.constants.F_OK,
|
||||||
function (err) {
|
(err) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(errorCode.toString() + ".html");
|
callback(errorCode.toString() + ".html");
|
||||||
|
|
Reference in a new issue