Skip to content

Commit

Permalink
better error message for defid-rpc-error
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh committed Mar 9, 2021
1 parent e2366db commit 9b7db50
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/testcontainers/src/chains/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ export abstract class DeFiDContainer {
* RPC error from container
*/
export class DeFiDRpcError extends Error {
readonly payload: any
public readonly code: number
public readonly rawMessage: string

constructor (payload: any) {
super('DeFiD RPC error from container')
this.payload = payload
constructor (error: { code: number, message: string }) {
super(`DeFiDRpcError from RPC: '${error.message}', code: ${error.code}`)
this.code = error.code
this.rawMessage = error.message
}
}

0 comments on commit 9b7db50

Please sign in to comment.