How to see detailed error message? All I see is just “Unhandled Exception”… How they say in documentation, when parser meets unhandled exception it calls @unhandled_exception[], which is declared in default configuration file auto.p from Parser distribution.
It is bad to show errors to visitors, so, by default, @unhandled_exception_release[] is called from @unhandled_exception[], which only reports that error occured (Unhandled Exception), and suggests to look for details in parser3.log, or switch on debug mode, so then error messages would output right to browser. To turn this debug mode on you need to modify auto.p file so @unhandled_exception[] would call @unhandled_exception_debug[] instead.
…expecting 'STRING' or '$' or '^'… Usually this is ýòî unbalanced brackets or forgotten ’^’ prefix before special parser characters ’;’, ’^’, ’$’ and others.
If you want character ’;’ to be shown, you need to write it as ’^;’ in your code. As a metter of principle, this is not always needed, but if you would use that form—it would do no harm ;)
…method of MAIN (MAIN) accepts minimum XX parameter(s)… This means that you call an operator and are trying to pass it less parameters then it requires.
Most frequently this error occurs when you type spaces or newlines between method parameter braces.
…method of MAIN (MAIN) accepts maximum XX parameter(s)… This means that you call an method and are trying to pass it more parameters then it can accept.
Most frequently this error occurs when you pass a method some string containing special characters, most likely character “;”, and forgetting to prefix them with “^”. Parser regards this character as a delimiter of method parameters.
…method_frame may not be overwritten with table/date/hash, store it to variable instead…
The code is trying to output an object which can not be represented as a string automatically. For example, if in the middle of page text use there would be ^date::now[] we would get this error.
To show a date object, one must do about this:
$now[^date::now[]]
^now.sql-string[]
Same applies to table, hash and other objects.
…no $MAIN:CLASS_PATH were specified… You are trying to code with @USE or ^use[]
but never set configuration variable $MAIN:CLASS_PATH. So Parser does not know where to look for class modules you are trying to link. Details are in documentation.
…not found along MAIN:CLASS_PATH… Module with operators or classes you are trying to link by @USE or ^use[] was not found along paths specified in configuration variable $MAIN:CLASS_PATH.
Frequently this problem is due to some white space after name of file with the module to be linked.
Also is could be that after @USE and list of modules one forgets to declare method @main[] and start their code right there, assuming that it would automatically become main.
…$SQL:drivers table must be defined… Not configured or not does not exist configuration file auto.p (located beside parser3.cgi). To test things quickly—download from appropriate section test document, unpack it to webspace of your site, and open it in browser.
For this file to be able to check all paths you would need to change configuration file auto.p and specify an absolute path in $confdir.
…driver implements API version 0xXXXX not equal to 0xYYYY… Parser requires other version of sql driver (libparser3mysql.so)
then installed.
The reason is likely in that you moved from one Parser version to other, but forgot to update your sql driver.
…outside of 'connect' operator… An attempt to execute some SQL query is taking place (^table::sql{}, ^int:sql{} and others) outside of an operator for connecting to DB ^connect[connect strings]{queries here}.
…transcodeFromUTF8 error… The one who configured your Parser either forgot to put suggested configuration file or spoiled it.
By default, if $request:charset is not specified (now is good moment to take a look at documentation) it is UTF-8.
Parser were not told in which charset are all its documents($request:charset) so it thinks they all are in UTF-8.
Hence if one asks to transcode something from UTF-8 to windows-1251 (by defining $response:charset) and on transform input there would be a text in windows-1251, Parser would protest.
…endless loop detected… Such message appeares if Parser detects too long a cycle.
For instance, if your would use the code ^while(1){something} you would see this message. Moreover, if you would use for or menu which would iterate more then 20000 times, you’d see it too.
…call canceled - endless recursion detected… You would see this message if Parser would think your code went into endless cycle.
Usually the reason is incorrect or too deep a recoursion (more then 1000 subcalls).
…SIGPIPE received. …
Such records appear in parser3.log, while everything seems working fine. What do they mean? When an answer from CGI-script is no longer needed by the client of web-server, for instance when user pressed the Stop button or connection were lost, web-server sends a script a signal “Hey, your output is no longer needed”.
Starting from 3.0.0007 version Parser intercepts this signal and creates an error “parser.interrupted”.
But in case Parser were run but not started to process the request, or, on the contrary, the request were already been processed the fact got recorded to log file by that record.
I have Parser assigned as a handler of .html files, in .htaccess I have ErrorDocument 404 /404.html directive. But if I open in browser a path to nonexistent file with html extension—instead of /404.html document I see some Parser error message. Nonexistent files with other name extensions are handled perfectly normal. What is this about?
You can always catch Parser exception "file.missing" and display /404.html instead yourself.
Method @unhandled_exception can be changed like this:
@unhandled_exception[exception;stack]
^if(^env:REMOTE_ADDR.match[^^developer (your) IP address]){
^unhandled_exception_debug[$exception;$stack]
}{
^if($exception.type eq "file.missing"){
^rem{*** if there is no file, doing internal ***}
^rem{*** redirect to the page with 404 error ***}
^rem{*** and don't forget about $response:status(404) on that page ***}
$response:location[/404/]
}{
^unhandled_exception_release[$exception;$stack]
}
}
|