Package perforce :: Module api :: Class Error
[frames] | no frames]

Class Error



object --+
         |
        Error

A Perforce Error message.

The Error class is a general Perforce data structure for passing around messages from a Perforce server. Each message has an error severity and a generic error category as well as the message text.

Instance Methods
 
__new__(T, S, ...)
Returns: a new object with type S, a subtype of T
 
__str__(x)
str(x)
 
clear()
Clear any previously set error.
 
format()
Returns: str or unicode
 
isError()
Returns: boolean
 
isFatal()
Returns: boolean
 
isInfo()
Returns: boolean
 
isWarning()
Returns: boolean
 
set(severity, message)
Set a new message for this error.
 
test()
Returns: boolean

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties
perforce.api.ErrorGeneric generic
The generic category of error this object refers to.
perforce.api.ErrorSeverity severity
The severity of this error.

Inherited from object: __class__

Method Details

__new__(T, S, ...)

 
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__

__str__(x)
(Informal representation operator)

 
str(x)
Overrides: object.__str__

clear()

 
Clear any previously set error.
Returns:
None

format()

 
Returns:
str or unicode

Note: Prefer to use this method over str(self) or unicode(self) when writing code that needs to handle messages from both Unicode and non-Unicode Perforce servers as the automatic conversions are dependent on the default codec and can sometimes fail if not all characters are supported by the codec.

isError()

 
Returns:
boolean

isFatal()

 
Returns:
boolean

isInfo()

 
Returns:
boolean

isWarning()

 
Returns:
boolean

set(severity, message)

 
Set a new message for this error.
Parameters:
Returns:
None

test()

 
Returns:
boolean

See Also: isWarning, isError