How to use the error function from loglevel
Find comprehensive JavaScript loglevel.error code examples handpicked from public code repositorys.
550 551 552 553 554 555 556 557 558 559
log.debug('block {'); block = parseBlock(); log.debug('}'); ensureHandle(block); if(!block.name) log.error('block with handle "' + block.handle + '" is missing a name.'); else blocks[block.name] = block; } else { logUnhandledGroup(curr);
70
264
0
GitHub: cxw42/TabFern
169 170 171 172 173 174 175 176 177 178
// We already checked that val is of the correct type above, // so we can go ahead and set it. S.set(key, val); } else { // This shouldn't happen, so it's a log.error if it does. let m = `Unexpected type ${typeof val} for ${key} - skipping`; log.error(m); stash(m); ok = false; continue; }
27
150
15
+ 11 other calls in file
GitHub: cxw42/TabFern
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113
} else { // New first tab treeidx = orig_tidxes[ctab.index]; } if(treeidx === false) { log.error({"Could not find where to put tab": ctab, "in window": winvn}); return false; } // --- Create the model entry if there isn't one ---
27
150
15
+ 10 other calls in file
121 122 123 124 125 126 127 128 129 130
proc.stdout.on('data', (data) => { log.info(data.toString()); }); proc.stderr.on('data', (data) => { log.error(data.toString()); }); // Success has_mounted_volume_root = true
15
29
5
+ 97 other calls in file
139 140 141 142 143 144 145 146 147 148 149
} catch (err) { log.error(getTimestamp() + ' ERROR: ' + err) } } } catch (err) { log.error(getTimestamp() + ' ERROR: Sync error. ' + err) } } /**
8
27
3
+ 279 other calls in file
GitHub: kryptokrona/hugin-api
90 91 92 93 94 95 96 97 98 99 100 101
try { saveWallet(wallet) } catch (err) { console.log(err) log.error('Error while saving wallet during interval.') } } /**
8
27
3
+ 155 other calls in file
65 66 67 68 69 70 71 72 73 74 75 76
Buffer.from(req.body.payload, 'hex') ) res.json(result) } catch (err) { log.error(getTimestamp() + ' ERROR: Some error occurred while sending message. ' + err) res.json("Sorry, but your request is invalid.") } }
8
27
3
+ 43 other calls in file
18 19 20 21 22 23 24 25 26 27
log.debug('handleError', error); if (error.name === 'AbortError') { // Ignore `AbortError` log.debug('Aborted', error); } else { log.error('API call failed. ' + error.name, error.message, error); throw error; } }
151
24
10
87 88 89 90 91 92 93 94 95 96
loginStatus = `Login called, expecting redirect function to redirect the user's browser now...`; log.info(loginStatus); } catch (error) { loginStatus = `Login attempt failed: [${error}]`; log.error(loginStatus); sendHtmlResponse(res); } } else { next(
34
52
12
+ 4 other calls in file
GitHub: alice-si/etheroscope
49 50 51 52 53 54 55 56 57 58
} amqp.connect(`amqp://${settings.RABBITMQ.address}`, opt, async (err, conn) => { if (err) { log.error('Failed to connect to RABBITMQ', err) process.exit(1) } conn.createChannel(async (err, ch) => { if (err) {
5
21
3
+ 3 other calls in file
200 201 202 203 204 205 206 207 208 209
.map(attachment => attachment.url) .filter(url => url.search(/jpg|jpeg|png/)); if (imageUrls.length > 0) { message.react('🤔') .catch(err => log.error(err)); let raidCreated = false; const processingChain = Promise.resolve();
20
15
0
+ 21 other calls in file
46 47 48 49 50 51 52 53 54 55
log.error('Error in awsMemcached set: ', err); } }); } } catch (err) { log.error('Error in awsMemcached set: ', err); return undefined; } }
7
13
1
+ 2 other calls in file
173 174 175 176 177 178 179 180 181 182
); reply.type('application/octet-stream'); reply.code(200).send(cacheData); } } catch (error) { log.error('TLM Proxy Error: ', error); reply.code(500).send(error); } }
7
13
1
39 40 41 42 43 44 45 46 47 48
try { // This throws an exception if JWT isn't able to be validated await verifier.verify(token); } catch (error) { log.error('JWT verifier error: ', error); const response = { status: '401', statusDescription: 'Unauthorized', body: 'Unauthorized',
7
13
1
107 108 109 110 111 112 113 114 115 116
VIEW_MGR = new EncryptionBasedViewMgr(fabric_front, VIEW_MODE, WORKLOAD_CHAINCODEID, viewstorage_contractID);; } else if (DATA_HIDING_SCHEME == global.PlainScheme) { VIEW_MGR = new PlainViewMgr(fabric_front, VIEW_MODE, WORKLOAD_CHAINCODEID, viewstorage_contractID);; } else { LOGGER.error(`Unrecognized Data Hiding Scheme ${DATA_HIDING_SCHEME}`); process.exit(1); } var view_creation_promises = [];
2
7
1
+ 5 other calls in file
155 156 157 158 159 160 161 162 163 164
await run({ ...executionParameters }); } catch (error) { logger.error(error.message) callback(error) } callback()
6
3
1
GitHub: Dima0dev/MetamaskFork
22 23 24 25 26 27 28 29 30 31
const localeFilePath = getLocalePath(code); const fileContents = await readFile(localeFilePath, 'utf8'); return JSON.parse(fileContents); } catch (e) { if (e.code === 'ENOENT') { log.error('Locale file not found'); } else { log.error(`Error opening your locale ("${code}") file: `, e); } process.exit(1);
4
14
1
+ 15 other calls in file
103 104 105 106 107 108 109 110 111 112
.then(() => { ipcRenderer.invoke("window-channel", "captureSignal", "data"); }); } }); } else log.error("FileReader has problems reading blob"); }; }; try { this.mediaRecorder.stop();
3
4
2
+ 3 other calls in file
GitHub: 0devs/fake-rest-api
16 17 18 19 20 21 22 23 24 25 26 27 28
request.get('/api/config') .end(function(err, res) { if (err) { logger.error(err); return; } var config = res.body;
2
4
0
161 162 163 164 165 166 167 168 169 170
var strippedErrors = _errors.map(function (error) { return stripAnsi(error); }); sendMsg('Errors', strippedErrors); for (var i = 0; i < strippedErrors.length; i++) { log.error(strippedErrors[i]); } if (useErrorOverlay) overlay.showMessage(_errors); initial = false; },
0
2
0
+ 4 other calls in file
loglevel.debug is the most popular function in loglevel (1470 examples)