Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/error-reporting-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Add deprecation notice ([#7427](https://github.com/MetaMask/core/pull/7427))
- This package is deprecated, and can be replaced with the
`Messenger.captureException` method from `@metamask/messenger`.

## [3.0.0]

### Changed
Expand Down
5 changes: 5 additions & 0 deletions packages/error-reporting-service/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# `@metamask/error-reporting-service`

> [!WARNING]
> This package is deprecated. To report errors, please use
> [`Messenger.captureException`](https://github.com/MetaMask/core/blob/8b3ad82c35d9d75c9a5096d847e7e8651e29cc5e/packages/messenger/src/Messenger.ts#L258-L263)
> instead.

Reports errors to an external app such as Sentry but in an agnostic fashion.

## Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import type { Messenger } from '@metamask/messenger';

/**
* The action which can be used to report an error.
*
* @deprecated This action is deprecated and will be removed in a future
* release. Please use `Messenger.captureException` directly instead.
*/
export type ErrorReportingServiceCaptureExceptionAction = {
type: 'ErrorReportingService:captureException';
Expand Down Expand Up @@ -142,6 +145,9 @@ type ErrorReportingServiceOptions = {
* // Now this will report an error without throwing it.
* exampleController.doSomething();
* ```
*
* @deprecated This service is deprecated and will be removed in a future
* release. Please use `Messenger.captureException` directly instead.
*/
export class ErrorReportingService {
name: 'ErrorReportingService' = 'ErrorReportingService' as const;
Expand Down Expand Up @@ -175,6 +181,8 @@ export class ErrorReportingService {
* Reports the given error to an external location.
*
* @param error - The error to report.
* @deprecated This function is deprecated and will be removed in a future
* release. Please use `Messenger.captureException` directly instead.
*/
captureException(error: Error): void {
this.#captureException(error);
Expand Down
Loading