How to use the error function from pino
Find comprehensive JavaScript pino.error code examples handpicked from public code repositorys.
GitHub: puzpuzpuz/cls-rtracer
31 32 33 34 35 36 37 38 39
}) } app.listen(3000, (err) => { if (err) { logger.error('The app could not start') } logger.info('The app is listening on 3000') })
23
296
8
+ 2 other calls in file
45 46 47 48 49 50 51 52 53 54
subscribe('queue1', handlersForQueue1), subscribe('queue2', handlersForQueue2) ]); } catch (err) { logger.error('railed to subscribe', err); } ``` With the above handlers registered, let's publish some events to the bus.
8
46
7
+ 7 other calls in file
GitHub: jambonz/sbc-inbound
241 242 243 244 245 246 247 248 249 250
fn: systemHealth.bind(null, redisClient, ping, getCount) }); return; }) .catch((err) => { logger.error({err}, 'Error creating health check server'); }); } if ('test' !== process.env.NODE_ENV) { /* update call stats periodically */
12
2
0
+ 3 other calls in file
GitHub: xyzuniverse/xyzbot
41 42 43 44 45 46 47 48 49 50
name, filename )); fs.watch(pluginFolder + "/" + name, global.reload); } catch (e) { logger.error(e); delete global.plugins[filename]; } } });
0
0
0
+ 3 other calls in file
111 112 113 114 115 116 117 118 119 120
}); } values[metricName] = value; } catch (error) { logger.error(error); } } for (const k of Object.keys(values)) {
0
0
0
11 12 13 14 15 16 17 18 19
logger.info('STATE: Connecting to MongoDB') await mongoClient.connect() logger.info('STATE: Successfully connected to MongoDB') return mongoClient } catch (error) { logger.error('STATE: Connection to MongoDB failed!', error) process.exit() } }
0
0
0