Perl Monk, Perl Meditation | |
PerlMonks |
Catalyst Debugging questions, specific and generalby Cody Fendant (Hermit) |
on Jun 13, 2022 at 08:25 UTC ( [id://11144707]=perlquestion: print w/replies, xml ) | Need Help?? |
Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question: I've got a legacy Catalyst app I'm working on, and it has a bug when a form is submitted. The controller basically looks like this
So if we have a GET to that action, you see the form and you get to fill it out. If we have a POST then it talks to the API to update a database then rather than getting the form you go back to list mode, because everything should be done by then. The GET works without a hitch, but the POST fails and I get an error screen. I put some logging in the API call and got nothing logged. So I moved back up to the update method and tried to log what was happening inside that if(method is POST) block and got nothing logged there either. Then I noticed that the browser's actually getting a 404 code when the POST request happens. I'm pretty baffled at this point. Is there some logical reason why my update in the controller should be fine when requested with GET and return a 404 for a POST? Is there some kind of routing magic which has gone wrong? I've got Catalyst's -DEBUG flag turned on and can see detailed logging only it doesn't help. It shows the post request being made with the right params, then it shows the error template being rendered. What can I do to better investigate this kind of thing?
Back to
Seekers of Perl Wisdom
|
|