Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
captureBreadcrumb(breadcrumb) {
if (this.get('isRavenUsable')) {
Raven.captureBreadcrumb(...arguments);
} else {
console.info(breadcrumb);
}
},
Raven.context(function() {
Raven.captureBreadcrumb({
message: 'Log-process line',
data: {
line: line,
filename: log
}
});
let parsed;
if (!parsed) {
try {
parsed = JSON.parse(line);
} catch (e) {
Raven.captureException(e);
line = line
.replace(/\u000e/igm, '')
.replace(/\u000f/igm, '');
parsed = JSON.parse(line);
Raven.context(function () {
Raven.captureBreadcrumb({
message: 'File that crashed log watcher',
data: {
filename
}
});
Raven.captureBreadcrumb({
message: 'Log-watcher JSON.parse failed',
data: {
line: l,
chunk: chunk.toString()
}
});
Raven.captureException(e);
})
}
protected async _onGuildMember(member: GuildMember, left: boolean): Promise
{
captureBreadcrumb({
category: left ? 'guildMemberRemove' : 'guildMemberAdd',
data: {
guild: `${member.guild.name} (${member.guild.id})`,
member: `${member.user.tag} (${member.id})`,
mePresent: {
guild: this.guilds.get(member.guild.id)?.members.has(this.user!.id) ?? 'Error',
member: Boolean(member.guild.me),
},
referenceEqual: member.guild === this.guilds.get(member.guild.id),
},
message: 'Info about the guild member event',
});
const guildModel: GuildModel = await member.guild.fetchModel();
Raven.context(() => {
Raven.captureBreadcrumb({torrent: torrent.link, docs});
Raven.captureException(err);
});
}
export const captureBreadcrumb = (o: *) => {
Raven.captureBreadcrumb(o)
}
Raven.context(() => {
Raven.captureBreadcrumb({
data:
{
torrent: torrent.link,
docs
}
});
Raven.captureException(err);
});
}
const breadcrumbContext = ({ message, category, level, ...options }) => {
Raven.captureBreadcrumb({
message,
category: category || 'logging',
level,
data: options,
});
};
this.webhook.error('ReactionError', reaction.message.guild!.shardID, e);
return;
}
}
if (reaction.message.author.id !== this.user.id
|| !reaction.message.embeds.length
|| !reaction.message.embeds[0].footer
)
{
reaction.message.channel.messages.delete(reaction.message.id);
return;
}
captureBreadcrumb({
category: 'messageReactAdd',
data: reaction.message.embeds[0],
message: 'Info about the embed',
});
const [, tag, name]: string[] = /^Requested by (.+?) \u200b\|.* (.+)$/
.exec(reaction.message.embeds[0].footer.text!) ?? [];
if (!tag || !name)
{
reaction.message.channel.messages.delete(reaction.message.id);
return;
}
const command: IResponsiveEmbedController = this.commandHandler.resolveCommand(name.toLowerCase()) as any;
if (!command)
{
case LogLevel.WARN:
sentryLevel = 'warning';
break;
case LogLevel.SILLY:
sentryLevel = 'debug';
break;
case LogLevel.VERBOSE:
sentryLevel = 'debug';
break;
default:
sentryLevel = LogLevel[level].toLowerCase();
break;
}
captureBreadcrumb({
category: 'console',
level: sentryLevel,
message: data,
});
}