Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Catalyst Debugging questions, specific and general

by stevieb (Canon)
on Jun 13, 2022 at 14:45 UTC ( [id://11144713]=note: print w/replies, xml ) Need Help??


in reply to Catalyst Debugging questions, specific and general

The controller basically looks like this

Please don't show us what the code basically looks like in pseudo code. Show the actual broken code.

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.

Did you ensure that whatever you're calling when you refer to method is POST is actually returning something? Are you actually calling the proper method to check if it's 'POST'? We don't know, because all you've got is pseudo code.

Did you actually check whether the update() function is being called?

A 404 is page not found. Do you have a route set up to handle the request? It sounds like that may be your problem. In Dancer2, you can specify a route type when defining a route:

any ['get', 'post'] => '/' => sub { ... post '/garage_update' => sub {

...etc. If a 'get' request comes in for /garage_update, it'll fail. The / route accepts both GET and POST. I don't know if Catalyst does things like this though.

Replies are listed 'Best First'.
Re^2: Catalyst Debugging questions, specific and general
by Cody Fendant (Hermit) on Jun 13, 2022 at 22:33 UTC

    I realise it's unhelpful to show pseudo-code but sure you realise it's equally unhelpful to tell me how to do routing in a completely different framework.

    To answer your questions:

    Did you ensure that whatever you're calling when you refer to method is POST is actually returning something?

    Yes, but also if it wasn't, it would continue as if it was a GET and not have the error. The routing is definitely working for GET.

    Did you actually check whether the update() function is being called?

    It must be being called or I wouldn't be seeing the form on a GET request.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11144713]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found