Skip to content

Commit

Permalink
Better exception handling for Ergo node
Browse files Browse the repository at this point in the history
  • Loading branch information
scalahub committed May 21, 2021
1 parent 5ca12f6 commit f8dfb30
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/scala/ergo/WalletUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,14 @@ class WalletUtil(ergoNode: ErgoNode) {
def generateTx(compileResult: CompileResult) = {
ergoNode.generate(getRequest(compileResult)) match {
case Right(json) => json
case Left(ex) =>
ex.printStackTrace()
throw new Exception(ex)
case Left(ex) => throw ex
}
}

def sendTx(compileResult: CompileResult) = {
ergoNode.send(getRequest(compileResult)) match {
case Right(json) => json
case Left(ex) =>
ex.printStackTrace()
throw new Exception(ex)
case Left(ex) => throw ex
}
}
}

0 comments on commit f8dfb30

Please sign in to comment.