capi icon indicating copy to clipboard operation
capi copied to clipboard

safeguard against invalid string supplied to `chain.blockHash`

Open harrysolovay opened this issue 1 year ago • 6 comments

How might we error out in cases such as the following?

chain
  .blockHash("a peanut butter chicken jelly tuna sandwich")
  .block()

This rune's signature looks like so:

BlockRune<{
  connection: Connection;
  metadata: FrameMetadata;
}, ConnectionError | ServerError | null>

Should we create a new error type? InvalidBlockHashError and unhandle it such that we get the following in the U track?

- ConnectionError | ServerError | null
+ ConnectionError | InvalidBlockHashError | ServerError | null

harrysolovay avatar Jul 04 '23 18:07 harrysolovay