Re: Error Trapping Within Classes




47computers@xxxxxxxxx wrote:
What do you mean by "mess up a line" ? Change it to include invalid
syntax?

Ah, I see what you mean. When I "messed up a line" what I tried was a
typo to a function call (on a result set from a mysqli->query call, I'd
normally call fetch_assoc, but instead tried fletch_assoc, just to see
how it would break). It looks like that was outside the scope of the
custom error trapping capabilities.

When I, instead, just change the name of a variable being used, then it
traps a simple "undefined variable" error just fine.

Well, I guess as long as some errors are untrappable, that's fine. On
that note, does my trapping at least give me the full available scope?
(error_reporting(E_ERROR | E_PARSE);)

Before the script is run it gets parsed which includes checking the
syntax. If the syntax is invalid, nothing happens -- at all.


Also, for the errors outside of the custom error trapping scope (such
as parser errors), the default response from the user's perspective is
to just see a blank page. Is there any way to change that? Or maybe
that's a result of something I changed early on and didn't quite know
that would be an affect of my change?

Basically, I'm just trying to make this website as user-friendly as
possible in terms of handling errors and telling the users everything
is ok (they kind of need their hands held sometimes), as well as
reporting as many errors as possible to me in a more obvious manner,
instead of just putting them in a log file.

Hopefully by the time your code gets into production you won't have any
syntax errors. You did at least try to run the script before putting
it out there, right?

.



Relevant Pages

  • Re: RfD - Enhanced local variable syntax, v4 (long)
    ... My syntax is from spring 1992, ... I prefer the automatic scoping, too, but won't recommend it for a standard ... A simpler form would be that locals are visible at least up to the ... be with SCOPE ... ...
    (comp.lang.forth)
  • Re: Ruby blocks in Python, a suggestion
    ... A function really is just a special case of a code block that ... scope and the calling scope. ... This syntax preserves that relationship, ... def my_codeblock: ...
    (comp.lang.python)
  • Re: Customizing Delegwiz.inf syntax question
    ... new to the syntax. ... find the list of the "SCOPE" identifiers? ... I want to find the correct identifiers for the .SCOPE object types for ... and computer account management. ...
    (microsoft.public.windows.server.active_directory)
  • Re: New bytecode assembly language to play with
    ... C syntax does have its deficiencies. ... many languages have. ... only available within the scope of a single function to be a pretty ... A globally declared function can only see ...
    (comp.lang.misc)
  • Re: function definition syntax
    ... :> In which case it might as well be a separate script - you don't need a function. ... :>: That's much more reliable than having to remember which syntax ... Always using POSIX ... :> not overlook restoring IFS. ...
    (comp.unix.shell)