Found meaner-looking emoji for errors

master
Keith Irwin 2017-04-25 09:56:04 -04:00
parent c2a3b14a90
commit a311f6f9f3
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
6 changed files with 16 additions and 16 deletions

View File

@ -6,7 +6,7 @@ module.exports = {
// Throw error
throwErr: (err,req=null)=>{
console.error(` ${err.stack}`);
console.error(` ${err.stack}`);
if (req){
if (env.mode==='production') {
req.flash('danger', 'An error occured. <br>Would you like to <a href="https://github.com/Tracman-org/Server/issues/new">report it</a>?');

View File

@ -66,10 +66,10 @@ module.exports = {
// Check for user and sk32 token
if (!loc.usr){
console.error("", new Error(`Recieved an update from ${socket.ip} without a usr!`).message);
console.error("", new Error(`Recieved an update from ${socket.ip} without a usr!`).message);
}
else if (!loc.tok){
console.error("", new Error(`Recieved an update from ${socket.ip} for usr ${loc.usr} without an sk32!`).message);
console.error("", new Error(`Recieved an update from ${socket.ip} for usr ${loc.usr} without an sk32!`).message);
}
else {
@ -77,13 +77,13 @@ module.exports = {
User.findById(loc.usr)
.then( (user)=>{
if (!user){
console.error("", new Error(`Recieved an update from ${socket.ip} for ${loc.usr}, but no such user was found in the db!`).message);
console.error("", new Error(`Recieved an update from ${socket.ip} for ${loc.usr}, but no such user was found in the db!`).message);
}
else {
// Confirm sk32 token
if (loc.tok!=user.sk32) {
console.error("", new Error(`Recieved an update from ${socket.ip} for usr ${loc.usr} with tok of ${loc.tok}, but that user's sk32 is ${user.sk32}!`).message);
console.error("", new Error(`Recieved an update from ${socket.ip} for usr ${loc.usr} with tok of ${loc.tok}, but that user's sk32 is ${user.sk32}!`).message);
}
else {
@ -100,12 +100,12 @@ module.exports = {
time: loc.time
};
user.save()
.catch( (err)=>{ console.error("", err.stack); });
.catch( (err)=>{ console.error("", err.stack); });
}
}
})
.catch( (err)=>{ console.error("", err.stack); });
.catch( (err)=>{ console.error("", err.stack); });
}
});
@ -123,7 +123,7 @@ module.exports = {
});
// Log errors
socket.on('error', (err)=>{ console.error('', err.stack); });
socket.on('error', (err)=>{ console.error('', err.stack); });
});
}

View File

@ -35,7 +35,7 @@ const
keepAlive:1, connectTimeoutMS:30000 }}
})
.then( ()=>{ console.log(`💿 Mongoose connected to mongoDB`); })
.catch( (err)=>{ console.error(` ${err.stack}`); });
.catch( (err)=>{ console.error(` ${err.stack}`); });
}
@ -131,7 +131,7 @@ const
// Production handlers
if (env.mode!=='development') {
app.use( (err,req,res,next)=>{
if (err.status!==404){ console.error(` ${err.stack}`); }
if (err.status!==404){ console.error(` ${err.stack}`); }
if (res.headersSent) { return next(err); }
res.status(err.status||500);
res.render('error', {
@ -145,7 +145,7 @@ const
else {
app.use( (err,req,res,next)=>{
if (err.status!==404) {
console.error(` ${err.stack}`);
console.error(` ${err.stack}`);
}
if (res.headersSent) { return next(err); }
res.status(err.status||500);
@ -181,7 +181,7 @@ const
});
})
.catch( (err)=>{
console.error(` ${err.stack}`);
console.error(` ${err.stack}`);
});
});

View File

@ -29,7 +29,7 @@ $(function(){
// Error callback
function(err) {
alert("Unable to set location.");
console.error('',err.message);
console.error('',err.message);
},
// Options

View File

@ -42,7 +42,7 @@ socket
console.log("⬇️ Disconnected!");
})
.on('error', function (err){
console.error('',err.message);
console.error('',err.message);
});
// Parse location
@ -202,7 +202,7 @@ function getAltitude(loc,elev,cb){
function getStreetViewData(loc,rad,cb) {
if (!sv) { var sv=new google.maps.StreetViewService(); }
sv.getPanorama({location:{lat:loc.lat,lng:loc.lon},radius:rad},function(data,status){
if (status!==google.maps.StreetViewStatus.OK){ console.error(new Error(' Street view not available:',status).message); }
if (status!==google.maps.StreetViewStatus.OK){ console.error(new Error(' Street view not available:',status).message); }
else { cb(data); }
});
}

View File

@ -3,7 +3,7 @@
{% block main %}
<section class='container'>
<h2> {% if code %}{{code}} {% endif %}{% if message %}{{message}}{% endif %}</h2>
<h2> {% if code %}{{code}} {% endif %}{% if message %}{{message}}{% endif %}</h2>
{% if stack %}<p>{{stack}}</p>{% else %}
{% if code == '404' %}<p>This page does not exist. Maybe you followed a dead link here. </p>
{% else %}<p>Would you please <a href="https://github.com/Tracman-org/Server/issues/new">report this error</a>? </p>{% endif %}