Skip to content

Commit

Permalink
Address breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBolding committed Oct 25, 2024
1 parent 4811770 commit b9177f9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ describe('BaseSnapExecutor', () => {
error: {
code: -32603,
message:
'Received non-JSON-serializable value: Expected the value to satisfy a union of `literal | boolean | finite number | string | array | record`, but received: 0.',
'Received non-JSON-serializable value: Expected a value of type `JSON`, but received: `0`.',
stack: expect.any(String),
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export class BaseSnapExecutor {
const serializedError = serializeError(error, {
fallbackError: unhandledError,
shouldIncludeStack: false,
shouldPreserveMessage: false,
});

const errorData = getErrorData(serializedError);
Expand Down Expand Up @@ -280,6 +281,7 @@ export class BaseSnapExecutor {
await this.#respond(id, {
error: serializeError(rpcError, {
fallbackError,
shouldPreserveMessage: false,
}),
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/snaps-rpc-methods/src/permitted/getFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('snap_getFile', () => {

expect(response.error).toStrictEqual({
code: -32603,
message: 'Internal JSON-RPC error.',
message: 'foo bar',
data: {
cause: {
message: 'foo bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe('createSnapsMethodMiddleware', () => {
data: {
cause: expect.objectContaining({ message: 'foo' }),
},
message: 'Internal JSON-RPC error.',
message: 'foo',
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ describe('implementation', () => {
error: {
code: -32603,
data: { cause: expect.objectContaining({ message: 'error' }) },
message: 'Internal JSON-RPC error.',
message: 'error',
},
id: 1,
jsonrpc: '2.0',
Expand Down

0 comments on commit b9177f9

Please sign in to comment.