bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!
2.66k stars 446 forks source link

XDebug? #1272

Open rkyoku opened 1 year ago

rkyoku commented 1 year ago

Hi,

Sorry, I wanted to use Slack for asking this, but the link to Slack on the F3 website does not work.

I just spent a couple of hours pulling my hair because I was not seeing the XDebug orange table in this brand new prototype-project I am writing (and which only contains a couple of lines of code for now). I thought I mis-installed it, mis-configured it, or whatever.

Finally, I found out that it was the F3's error handling that was displaying an error in stead of XDebug, because of course XDebug does not show the orange tables for caught errors.

I did not find anything on the topic: how can I show the XDebug orange tables with F3? Do I have to maybe trigger a custom Exception in the 'ONERROR' custom callback?

I'm surprised that I did not find anything on the topic, which means that either nobody is using XDebug or, way more likely, that people have the orange tables but I did not because I did something wrong in these 2 or 3 lines of code.

Thank you kindly,

EDIT: I looked into another project that I did using F3 several years ago, and I found out that I was using restore_error_handler, but it's not ideal as I have to catch errors myself instead of leveraging F3's error handler

ikkez commented 1 year ago

You see orange tables because xdebug overwrites the default error handler... and so does F3 as well. If you don't like the default error handler by fat-free, feel free to implement your own or install any other one... for example this one https://github.com/ikkez/f3-falsum

Rayne commented 1 year ago

Regarding slack: We switched to Matrix. The Matrix link should work.