Add error details to raised validation errors#14
Add error details to raised validation errors#14vfonic wants to merge 2 commits intopenseo:masterfrom
Conversation
|
did you see that the tests include webflow api credentials that use a test-page? https://github.com/penseo/webflow-ruby/blob/master/test/webflow_test.rb#L3-L6 you can use that to regenerate whatever is necessary (aka batteries included) |
|
@phoet yes, I can use that to access the API. However, WebFlow API doesn't allow you to create collections or fields in collections. I need a field that is set to be single line and then it fails validation with the validation message shown in What I did was: I created such field in one of my sites and then ran the test, recorded that and changed couple of things like collection ID. I think perhaps the best way to make sure this is all well done, without any mistakes on my end, you could create a field and set it to be single line and then remove the VCR cassette recording and run the test to generate it yourself. EDIT: I didn't do this test on |
WebFlow API sometimes provides the
problemsarray field which sometimes adds more details about the returned error.In my case, I was receiving "ValidationError" back, but I didn't know which field failed validation and why.
This PR adds the
problemsarray to the raised error message so that the users of webflow-ruby can get more information into what caused the error.https://developers.webflow.com/#errors
PS This was difficult to test. I ran the test by connecting to my WebFlow site and then manually changed the VCR cassette. Perhaps it would be best to re-record this after you add the validation on
nameto be on a single line.Before
After