The jsonrpc library that this project uses handles errors from the jsonrpc payload out of the box. Unfortunately this swallows a useful information that would make the user experience better. Here is an example of where the extra information would be useful.
While testing out #41 I intentionally supplied an invalid value for the high_availability attribute by running the following code.
testing.go:569: Step 1 error: errors during apply:
Error: jsonrpc2: code 10 message: invalid parameters
on /tmp/tf-test348309895/main.tf line 16:
(source code not available)
Unfortunately this doesn't tell the user what parameter was invalid. In this case I only knew it was the high_availability field because I intentionally caused the problem.
I tcpdump'ed the traffic while causing this error so that I could see the response data. We see in the output below that the response data does include which field was problematic.
The jsonrpc library that this project uses handles errors from the jsonrpc payload out of the box. Unfortunately this swallows a useful information that would make the user experience better. Here is an example of where the extra information would be useful.
While testing out #41 I intentionally supplied an invalid value for the
high_availability
attribute by running the following code.This failed to apply for the following reason.
Unfortunately this doesn't tell the user what parameter was invalid. In this case I only knew it was the
high_availability
field because I intentionally caused the problem.I tcpdump'ed the traffic while causing this error so that I could see the response data. We see in the output below that the response data does include which field was problematic.
Here is the data cleaned up to show what the json response was
We need to make sure this information is reported in the terraform error output so simple fixes like this are obvious to the end user.