Jump to content

Disabling custom exceptions


Deltanic
 Share

Recommended Posts

Is it possible to disable ProcessWire's custom exceptions? I'm building an abstraction layer ontop of ProcessWire and would love to use xDebug. However, as PW currently works, this isn't really going well as seen below:

Schermafdruk%202014-11-12%2017.08.43.png

Both messages display and xDebug isn't of any use.

So is it possible to disable PW error and exception messages, and if so, how?

Thanks in advance.

Link to comment
Share on other sites

  • 3 weeks later...

@Deltanic,

I use xdebug with PW almost daily. It works great and I don't need to disable any PW exceptions to get it working. In my case, I use xdebug along with the vdebug plugin for vim and the xdebug helper extension for chrome (similar ones exist for FF) and they do take some configuration to get right - but none of it in PW. Could you explain exactly what problem it is you are having with using xdebug?

  • Like 2
Link to comment
Share on other sites

PW is not 'failing' for a dumb reason and it tell you what has gone wrong. You can do a try & catch to handle it. 

What? I'm not saying PW is 'failing' on me, I'm saying I don't need both xDebug and PW exception messages. This has nothing to with my code, or how to handle an exception.

@Deltanic,

I use xdebug with PW almost daily. It works great and I don't need to disable any PW exceptions to get it working. In my case, I use xdebug along with the vdebug plugin for vim and the xdebug helper extension for chrome (similar ones exist for FF) and they do take some configuration to get right - but none of it in PW. Could you explain exactly what problem it is you are having with using xdebug?

Interesting. I haven't got any luck so far. As you can see in the picture in the OP, my xDebug messages are all put in a single message, rather than having the callstack. Considering PW does provide the callstack well formatted, my initial thought was to disable PW exceptions and have it all being displayed through xDebug. Still not sure what I could do to get my xDebug messages right, but to me it looks like PW is somewhere having an exception and/or error handler that throws its own error message.

Link to comment
Share on other sites

@Deltanic,

It sounds like you are doing after-the-fact debugging using the call-stack shown in the browser. I try not to do that as I don't find it as helpful as using breakpoints or single-stepping new code in my IDE of choice (chrome + xdebug helper & vim + vdebug.) In an IDE you get the full call-stack, variables, code, execution location and can use breakpoints etc.

As you can see in the picture in the OP, my xDebug messages are all put in a single message, rather than having the callstack. Considering PW does provide the callstack well formatted, my initial thought was to disable PW exceptions and have it all being displayed through xDebug. Still not sure what I could do to get my xDebug messages right

Regarding cleaning up the format of the xdebug callstack output - have you tried the xdebug stack-trace documentation? (There's plenty of good documentation for xdebug.) Like I said, I don't use xdebug the way you seem to want to so I can't help any more than that.

I would recommend giving some kind of IDE a go - as I find it so much more convenient for debugging than in-browser stack traces.

  • Like 4
Link to comment
Share on other sites

@netcarver thanks on the insight, I'll try this chrome extension. Currently I use xdebug but the stack trace (without the break points you mentioned) is rarely of any real use.

I also us the Chrome Logger module by soma, which is very useful most of the time, but it uses html headers which are sometimes too big because the objects it tries to log, are too complex.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...