if (err.status === 'not found') { cb({ statusCode: 404 }) return } else { // <--- now } is on same line as { cb({ statusCode: 500 }) return }