(error, context)
| 725 | * 手动捕获异常 |
| 726 | */ |
| 727 | export function captureException(error, context) { |
| 728 | const sentry = getSentry(); |
| 729 | if (context) { |
| 730 | sentry.withScope(scope => { |
| 731 | Object.entries(context).forEach(([key, value]) => { |
| 732 | scope.setContext(key, value); |
| 733 | }); |
| 734 | sentry.captureException(error); |
| 735 | }); |
| 736 | } else { |
| 737 | sentry.captureException(error); |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | /** |
| 742 | * 手动捕获消息 |