本文整理汇总了TypeScript中raven-js.captureMessage函数的典型用法代码示例。如果您正苦于以下问题:TypeScript captureMessage函数的具体用法?TypeScript captureMessage怎么用?TypeScript captureMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了captureMessage函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: logWarning
logWarning(message: string): void {
if (this.config.isLocal) {
console.warn(message);
} else {
Raven.captureMessage(message, {level: 'warning'});
}
}
开发者ID:finleysg,项目名称:bhmc,代码行数:7,代码来源:bhmc-error-handler.service.ts
示例2: handleError
handleError(err) {
let error: any = null;
let message: any = null;
if (err instanceof CustomError) {
error = err.originalError;
message = err.message;
} else {
error = err;
}
if (error instanceof HttpErrorResponse) {
message = 'BACKEND: ' + message
switch (error.status) {
case 0: {
error = new UnreachableError(error.error);
message = message + ' - Unreachable Error';
break;
}
case 400: {
error = new BadInputError(error.error);
message = message + ' - Bad Input Error';
break;
}
case 403: {
error = new ForbiddenError(error.error);
message = message + ' - Forbidden Error';
break;
}
case 404: {
error = new NotFoundError(error.error);
message = message + ' - Not Found Error';
break;
}
default: {
error = new BaseError(error.error)
message = message + ' - Base Error';
break;
}
}
} else if (error instanceof Error) {
message = 'FRONTEND: ' + message
// Additional processing for GENERAL exceptions
} else {
// For anything else
}
console.log(error);
console.log(message);
Raven.captureMessage(error, {
level: 'info',
extra: {
error: error,
message: message,
}
});
}
开发者ID:faxad,项目名称:cartify,代码行数:59,代码来源:app-error-handler.ts
示例3: report
export function report(userFeedback: string, feedbackCategory: string, userEmail?: string): void {
if (!Raven.isSetup()) {
throw new IllegalStateError('Error reporter not initialized.');
}
Raven.setUserContext({email: userEmail || ''});
Raven.captureMessage(userFeedback, {tags: {category: feedbackCategory}});
Raven.setUserContext(); // Reset the user context, don't cache the email
}
开发者ID:fang2x,项目名称:outline-server,代码行数:8,代码来源:error_reporter.ts
示例4: logResponse
logResponse(message: string, response: Response) {
if (this.config.isLocal) {
// TODO: handle text or blob responses
console.info(`${response.status}: ${JSON.stringify(response.json())}`)
} else {
const options: any = {
level: 'error',
extra: {'response': response}
};
Raven.captureMessage(message, options)
}
}
开发者ID:finleysg,项目名称:bhmc,代码行数:12,代码来源:bhmc-error-handler.service.ts
示例5: report
report(userFeedback: string, feedbackCategory: string, userEmail?: string): Promise<void> {
Raven.setUserContext({email: userEmail || ''});
Raven.captureMessage(userFeedback, {tags: {category: feedbackCategory}});
Raven.setUserContext(); // Reset the user context, don't cache the email
return Promise.resolve();
}
开发者ID:fang2x,项目名称:outline-client,代码行数:6,代码来源:error_reporter.ts
示例6: ravenCaptureMessage
protected ravenCaptureMessage(message: string,
options: RavenOptions) {
Raven.captureMessage(message, options);
}
开发者ID:NGO-DB,项目名称:ndb-core,代码行数:4,代码来源:logging.service.ts
注:本文中的raven-js.captureMessage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论