#Production Errors

18 messages · Page 1 of 1 (latest)

terse sluice
#

Hi,

I just put my site on a server using forge and started getting production errors when going to my api endpoints, but on local it was working fine.

The error was like incorrect name or like minor things which I would think it would stop my local for working, maybe its less strict?

How can I make my local have the same rules and errors as production if possible, as when I update to production I dont want to start fixing these bugs there.

hope that makes sense 🙂

fallen scarab
terse sluice
#

Sorry thought it would not be relevant as it’s not about the error it’s more about seeing the errors only in production

fallen scarab
#

Go to the file and line number mentioned, and see why the variable would be null rather than an object like you’re expecting.

terse sluice
#

I have fixed it but not sure why I never got it locally

fallen scarab
#

You clearly have code that is working with different data and therefore acting differently in different environments.

#

So again, go to the file and line number mentioned, and work backwards.

#

You’re probably trying to find something that exists locally but not on production, hence the null in production.

ember abyss
# terse sluice Sorry thought it would not be relevant as it’s not about the error it’s more abo...

It's extremely relevant as the error would tell you what's going on. Like the error you show below tells you your code is doing something like $obj->vehicle_amount. Locally you're testing things with a certain setup, certain values in the database, and that works. But the code you have always assumes $obj is something. So you might have users without a certain relation or something (I don't know what the actual issue is), so behavior is different, that's where those kinds of errors come from

terse sluice
fallen scarab
terse sluice
#

Like I said I did solve the error already I just did not realise why I was not getting the error locally

fallen scarab
#

Don’t try and overthink error messages. Read them literally. If it says something is wrong in a file at a certain line, then look there.