exw3 icon indicating copy to clipboard operation
exw3 copied to clipboard

Better error messages for missing options

Open hswick opened this issue 5 years ago • 2 comments

Thanks @pik694 exw3 will throw an error message if you don't include gas, from, or contract address in a transaction. Which helps with debugging.

Right now the error messages look like this:

** (MatchError) no match of right hand side value: {:error, :missing_gas}

Which is useful, and does tell what is going wrong. But I think it would be better if we could have a more readable and clear error message like

(MissingOptionsError) transaction request is missing the :gas field

hswick avatar Aug 30 '18 19:08 hswick

Hi, new to project (would like to contribute). So this would just be a simple modification to the handle_call function, just with a more human readable description ?

Pongch avatar Sep 26 '18 13:09 Pongch

Hi there! It's a bit more complicated than that. Its essentially modifying some of the behavior for check_option, example used here: https://github.com/hswick/exw3/blob/master/lib/exw3.ex#L665 To be more human readable like you said.

hswick avatar Sep 26 '18 22:09 hswick