Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silenced errors will still throw ErrorExceptions #13

Open
ghost opened this issue Aug 11, 2012 · 3 comments
Open

Silenced errors will still throw ErrorExceptions #13

ghost opened this issue Aug 11, 2012 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 11, 2012

I wanna catch, trace and log errors, and hide them from users of my website, so I've put a lil' function at the top of my bootstrap script to turn Errors into ErrorExceptions, and it's been throwing Exceptions without mercy. A little digging later, and it looks like you've used them bloody @'s in your shorthand2xpath method.

I've been pondering over it for a little less than an hour now, and I can't really think of a solution that's particularly graceful. Pushing 7 empty elements on top of the array? God, no. Using isset in every ternary operation? Being forced through an entire season of an American sitcom (of your picking!) sounds more appealing. Predefine the array with array_fill? I guess, maybe?

But yeah, anyway, maybe you've got an idea.

@Kroc
Copy link
Owner

Kroc commented Aug 14, 2012

Basically there is no error handling in DOMTemplate at the moment, so I'm open to ideas. It does need to be robust because some errors are normal (an xpath returned no elements).

I will give error handling my consideration to try find something elegant, it's the biggest "must have" feature right now IMO.

@ghost
Copy link
Author

ghost commented Aug 14, 2012

Does there need to be error handling? I think that'd be more a task for the application. I think what would make sense is: not to throw errors, and definitely not to silence them; and, replace pre-programmed errors with exceptions where that's appropriate.

I'm no expert in this sort of thing, though.

@Kroc
Copy link
Owner

Kroc commented Aug 14, 2012

Neither I; error handling and unit testing are two big areas of programming I have not dared to conquer yet :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant