Smutty


Smutty.Smutty_Error

Class Smutty_Error

Smutty_Object
|
+--Smutty_Error

public class Smutty_Error
extends Smutty_Object

this class handles all exceptions and warnings generated by smutty.

/


Constructor Summary

Smutty_Error()

constructor

Method Summary
nothing

addWarning(String message, String wikiHelp)

adds a warning message

nothing

enableTemplates()

enables the use of smarty templates for error reporting purposes

nothing

errorHandler(int errno, String errstr, String errfile, int errline, int errcon)

handles an error from php.

static nothing

fatal(String message, String wikiHelp, int code)

call this to raise a fatal error

static integer

getErrorReporting()

returns the current level of error reporting

static Smutty_Error

getInstance()

returns the singleton instance for this object.

array

getWarnings()

returns an array of warning messages that have been generated

boolean

isUsingTemplates()

returns a boolean indicating if templates will be used when reporting an error

static nothing

setErrorReporting(int type)

sets the level of error reporting

private nothing

showStandard(String message, String wikiHelp)

shows an error message with standard output

private nothing

showTemplate(String message, String wikiHelp)

shows an error message using smarty templates

static nothing

warning(String message, String wikiHelp)

this method is used to indicate that something has gone wrong, but that it's not serious.

Constructor Detail

Smutty_Error

public Smutty_Error()

constructor


Method Detail

addWarning

public nothing addWarning(String message, String wikiHelp)

adds a warning message

Parameters:
message - the warning message
wikiHelp - the wiki help page
Go to code

enableTemplates

public nothing enableTemplates()

enables the use of smarty templates for error reporting purposes

Go to code

errorHandler

public nothing errorHandler(int errno, String errstr, String errfile, int errline, int errcon)

handles an error from php.

Parameters:
errno - severity
errstr - description
errfile - the files full path
errline - the line
errcon - the contect
Go to code

fatal

public static nothing fatal(String message, String wikiHelp, int code)

call this to raise a fatal error

Parameters:
message - the error message
wikiHelp - name of wiki help page
code - http status code
Go to code

getErrorReporting

public static integer getErrorReporting()

returns the current level of error reporting

Returns:
error reporting level
Go to code

getInstance

public static Smutty_Error getInstance()

returns the singleton instance for this object. this singleton can then be used to set global error reporting options.

Returns:
the singleton
Go to code

getWarnings

public array getWarnings()

returns an array of warning messages that have been generated

Returns:
array of warning strings
Go to code

isUsingTemplates

public boolean isUsingTemplates()

returns a boolean indicating if templates will be used when reporting an error

Returns:
are we using templates
Go to code

setErrorReporting

public static nothing setErrorReporting(int type)

sets the level of error reporting

Parameters:
type - the errors types to show
Go to code

showStandard

private nothing showStandard(String message, String wikiHelp)

shows an error message with standard output

Parameters:
message - the error message
wikiHelp - name of wiki help page
Go to code

showTemplate

private nothing showTemplate(String message, String wikiHelp)

shows an error message using smarty templates

Parameters:
message - the error message
wikiHelp - name of wiki help page
Go to code

warning

public static nothing warning(String message, String wikiHelp)

this method is used to indicate that something has gone wrong, but that it's not serious. just a warning. these warning messages can then be reached by the getWarnings() method

Parameters:
message - the warning message
wikiHelp - the wiki help page
Go to code

Smutty