This logs all the errors to the log file: {internal_data}/webdav-error.log
The third parameter "false" tells it to overwrite the file for each logged message, instead of appending it.
Ok, I am sure that once the 1.0 comes out all this will be properly documented, but in the meanwhile I may just do some reverse engeneering of sorts.
You seems to have 3 different Error reporting tool:
1) $this->responseError()
PHP:
/**
* Controller response for when you want to throw an error and display it to the user.
*
* @param string|array Error text to be use
* @param integer An optional HTTP response code to output
* @param array Key-value pairs of parameters to pass to the container view
*
* @return XenForo_ControllerResponse_Error
*/
2) XenForo_Helper_File::log()
PHP:
/**
* Method for writing out a file log.
*
* @param string $logName 'foo' will write to {internalDataPath}/foo.log
* @param string $logEntry The string to write into the log. Line break not required.
* @param boolean $append Append the log entry to the end of the existing log. Otherwise, start again.
*
* @return boolean True on successful log write
*/
3) $this->_params['exception']
This method catches automatically server error 500
Given that the third, even if lovely, really works with thrown exceptions, we seems to be just left with option 1 to talk to the user, and option 2 to write down a meaninful log for the admin/developer.
The server error log, I believe, is reserved for logging of uncaught exceptions generated at the application level. Although you could insert records into the log table (xf_error_log) yourself, the log format is very specific and you may not have the relevant info required to be inserted.
So yes, if you want to show the error to the end-user, return an Error response.
Otherwise use the file helper to log the message.
I now have to get the parameter's for responseError/responseMessage. If I try a
PHP:
return $this->responseError('My Personal Message', 200, array('message' => $aBufferOfText));
I do get a correct error window with the My Personal Message string, but I don't get the further buffer. True, I can just concatename the buffer to the actual message string, but if there was a "cleaner" method of doing it, then would have been lovely.
Yep. Useful in those cases when multiple validation processes have failed. For example, in a registration form.
Code:
$errors = array(
new XenForo_Phrase('error_phrase1'),
new XenForo_Phrase('error_phrase2'),
new XenForo_Phrase('error_phraseN'),
);
return $this->responseError($errors);
Ah! There you go. So you can pass a text of a xenphrase object or an array containing test and /or objects.
This actually solves my problem and I can simply thrw a single error for multiple submissions issues.
Regarding the scrollbar, I am (improperly) using the output for variable dumping. The ajax error window doesn't seem to display a scrollbar, so you can read the content 'till the end of the screen and that's all.