Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting mainnet server on testnet bridge results in unfriendly error message. #423

Closed
piotr-iohk opened this issue Jun 17, 2019 · 1 comment
Assignees

Comments

@piotr-iohk
Copy link
Contributor

piotr-iohk commented Jun 17, 2019

Release Operating System Cause
next Linux Code v Configuration v Environment v Human v Unknown

Context

Starting mainnet server on testnet bridge (or vice-versa) results in unfriendly error message.

Steps to Reproduce

  1. cardano-http-bridge start --port 8080 --template mainnet
  2. cardano-wallet serve --network testnet

Expected behavior

More user friendly error message could be presented, e.g.:

Corresponding http-bridge appears to be running on "mainnet" network 
while cardano-wallet server was started on "testnet". 
Please start server on the same network as http-bridge.

Actual behavior

[iohk.#messagecounters.switchboard:Warning:ThreadId 10] [2019-06-17 10:55:38.61 UTC] time_interval_(s) = 0
cardano-wallet: ErrUnexpectedNetworkFailure (Link {_segments = ["testnet","tip"], _queryParams = []}) (FailureResponse (Response {responseStatusCode = Status {statusCode = 400, statusMessage = "Bad Request"}, responseHeaders = fromList [("Content-Length","20"),("Content-Type","text/plain"),("Date","Mon, 17 Jun 2019 10:55:38 GMT")], responseHttpVersion = HTTP/1.1, responseBody = "Invalid network name"}))

Resolution Plan

  1. Add a new error constructor to ErrNetworkUnreachableErrInvalidNetwork.
  2. Handle "400 Bad Request" - "Invalid network name" when making requests to node backend.
  3. Format error message for ErrInvalidNetwork. It will not be able to say what network the http-bridge appears to be running on.

PR

Number Base
#538 master

QA

  1. There is an integration test lib/http-bridge/test/integration/Cardano/Wallet/HttpBridge/NetworkSpec.hs.
@piotr-iohk
Copy link
Contributor Author

lgtm 👍
I've added additional integration test in #546.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants