RSWSMUGirl2016 / SMU_Nav

0 stars 0 forks source link

Returning 200 when it should be an error #48

Open wspurgin opened 9 years ago

wspurgin commented 9 years ago

The die statement here is meant to convey an error, but a die statement returns 200 by default. Which means when there are errors on the backend with connecting to mysql, the front end treats it as a good response (which is causing a few errors).

Since you're using slim, you can use it to return proper status codes instead of just the php die statement. Here are the docs for that http://docs.slimframework.com/#Response-Status

Cheers

AustinCWells commented 9 years ago

Great, thanks for this resource.