Skip to content

Swap out puts error messages for render json response#3

Open
tjp2021 wants to merge 1 commit intomasterfrom
acme-api-fix
Open

Swap out puts error messages for render json response#3
tjp2021 wants to merge 1 commit intomasterfrom
acme-api-fix

Conversation

@tjp2021
Copy link
Owner

@tjp2021 tjp2021 commented Sep 7, 2018

@speric

Swapped out the puts error messages for a JSON response. Please review

@speric
Copy link

speric commented Sep 8, 2018

At this point, do you think it's worth it to write an automated test for this endpoint? Maybe a request spec?

@tjp2021
Copy link
Owner Author

tjp2021 commented Sep 9, 2018

Hm. I had a request spec in there but it looks like its not working as intended. Im going to get it fixed today. I do have a question for you @speric. I've changed some of the error handling in the controller from puts to render json. But some of the error handling has been abstracted away in logic away from the controller (customer.rb and fakepayservice.rb). It appears that the render json only works in the controller and I'm trying to figure out how to turn that error handling into some actionable in the api response. So far im looking at the rescue_from method. Is that a good path to go down or do you have an alternative recommendation?

Thanks

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

Successfully merging this pull request may close these issues.

2 participants