Skip to content

Commit 278d647

Browse files
Mrtenzmetamaskbot
andauthored
feat: Add snap_trackError method for error tracking through Sentry (#3498)
This adds a new RPC method `snap_trackError`, which can be used to track errors in Sentry. It accepts a `name`, `message`, and `stack`, which should be turned into a proper `Error` class again on the client end before sending it to Sentry with `Sentry.captureException`. To make the API a bit easier to use, I've added a `getJsonError` helper function which takes an error (string, `Error` class, or other value) and turns it into the properties expected by `snap_trackError`: ```ts import { getJsonError } from '@metamask/snaps-sdk'; try { // ... } catch (error) { await snap.request({ method: 'snap_trackError', params: { error: getJsonError(error), }, }); } ``` --------- Co-authored-by: MetaMask Bot <[email protected]>
1 parent ec2b548 commit 278d647

File tree

43 files changed

+912
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+912
-78
lines changed

packages/examples/packages/background-events/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "wRIfHJ8IQh76ktT6bMPaQeL76aUSIfOfdusGJAvU8j0=",
10+
"shasum": "ry7ytwwA6jLu2lyh37cu4GnxJGRWw9l4HtHqfk/YxKs=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/bip32/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "kQsI1Pe5Ds8AQM+3sbKnBpqCHbhkSlgPeuErzig1BSU=",
10+
"shasum": "IrZRKN11QSuHCvwhtjLMKYkeQzo3dQbcnEM3h5UxMHU=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/bip44/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "ZpWq5pSZ2qjXZHc2awkpSbUbO10vuT8uyRcVy6xyqkg=",
10+
"shasum": "fbvXCpHz9/c+J/oGwc6cfNlmo44+YzB5+KzQGjg3UrQ=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/client-status/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "IGEfi7rQXI0Tu98aDyGbtUAeUIE0CMZonR0leSBUl8E=",
10+
"shasum": "OH3tTkb7IP7btCwvcg/aPl8KzsXTNN74U0+7mDnDbvI=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/cronjob-duration/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "vzzpBIX/vOKbSw6x8JXHzMMeBe8lpOhaZi0KSZk9uOY=",
10+
"shasum": "ikxPXqPpsUrLhRdpG++xXZq+P6nUtjy63k2MNa3senk=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/cronjobs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "eTktdzvPzAr/fMl6sZALdcUL2LOW3YhiUwqi28na8js=",
10+
"shasum": "OwBJvrucDv6ozRGjtbbQbxDxM47wa0PSvDyPXAbypv8=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/dialogs/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "peqfxtsGBNeHO3WooTYIJK4bnujccveEwEd/FfGnItE=",
10+
"shasum": "o/O+FW4JxMxiKE0SG0WMTeztDEGRD9OYTl38kg0gDW4=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/ethereum-provider/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "TVX02bG6spSFsyki6sdzEnH/mWydCmiCBikwbTzAtUU=",
10+
"shasum": "1I4qm6Fj6W2wx+m5PhMqR9B+xZEvapmvEhRG+y8rrN8=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/ethers-js/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "fo34896eh0i/mRyFqXftntOqS1VtBPsTrh7dMfrE9/A=",
10+
"shasum": "8BYNSeBmkTFOGtfAoCr40kBtyWFuphUpx1Ysrc69wxM=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/examples/packages/file-upload/snap.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/MetaMask/snaps.git"
88
},
99
"source": {
10-
"shasum": "2iuAhDEJAimbHAlgESzJfXj209w2Nu53AINf9xLClHc=",
10+
"shasum": "6e1fd7mgrhCixaloe7WHbq31QyA9F7L1TDAOiCqo8U8=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

0 commit comments

Comments
 (0)