org.tmatesoft.svn.core
Class SVNErrorMessage
- Serializable
public class SVNErrorMessage
implements Serializable
The
SVNErrorMessage class represents error and warning messages describing
reasons of exceptions occurred during runtime. An error message may be of two levels:
An error message may contain an error messages stack trace, what is useful for
error reason investigations. Also such a message contains an error code (
SVNErrorCode)
what gives an ability to find out what kind of an error it is.
Error messages may be formatted.
SVNErrorMessage performs formatting with the
help of the JDK's
MessageFormat class. To make a formatted message, use
MessageFormat parsable format patterns and provide an array of related objects
when creating an
SVNErrorMessage.
Error messages may be supplied within exceptions of the main exception type -
SVNException.
static int | TYPE_ERROR- Error messages of this type are considered to be errors (most critical) rather
than warnings.
|
static int | TYPE_WARNING- Error messages of this type are considered to be warnings, what in certain
situations may be OK.
|
static SVNErrorMessage | UNKNOWN_ERROR_MESSAGE- This is a type of an error message denoting an error of an unknown nature.
|
static SVNErrorMessage | create(SVNErrorCode code)- Creates an error message given an error code.
|
static SVNErrorMessage | create(SVNErrorCode code, String message)- Creates an error message given an error code and description.
|
static SVNErrorMessage | create(SVNErrorCode code, String message, Object object)- Creates an error message given an error code, description and may be a related
object to be formatted with the error description.
|
static SVNErrorMessage | create(SVNErrorCode code, String message, Object object, int type)- Creates an error message given an error code, description, an error type
(whether it's a warning or an error) and may be a related object to be
formatted with the error description.
|
static SVNErrorMessage | create(SVNErrorCode code, String message, Object[] objects)- Creates an error message given an error code, description and may be related
objects to be formatted with the error description.
|
static SVNErrorMessage | create(SVNErrorCode code, String message, Object[] objects, int type)- Creates an error message given an error code, description, an error type
(whether it's a warning or an error) and may be related objects to be
formatted with the error description.
|
static SVNErrorMessage | create(SVNErrorCode code, String message, int type)- Creates an error message given an error code, description and a type (
whether it's a warning or an error).
|
SVNErrorMessage | getChildErrorMessage()- Returns an error message (if any) that was returned from a
deeper method call.
|
SVNErrorCode | getErrorCode()- Returns the error code of the error.
|
String | getFullMessage()- Gets a string representation of the entire stack trace of
error messages (if they were provided) starting with the initial
cause of the error.
|
String | getMessage()- Returns an error description formatted with the
related objects if needed.
|
String | getMessageTemplate()- Returns an error description which may contain message format
patterns.
|
Object[] | getRelatedObjects()- Returns objects (if any) that were provided to be formatted
with the error description.
|
int | getType()- Returns the type of the error (whether it's a warning or an error).
|
boolean | hasChildErrorMessage()- Says if this error message object has got a child error message.
|
boolean | isWarning()- Returns true if this message is a warning message, not error one.
|
void | setChildErrorMessage(SVNErrorMessage childMessage)- Sets a child error message for this one.
|
String | toString()- Returns a string representation of this error message object
formatting (if needed) the error description with the provided related objects.
|
SVNErrorMessage | wrap(String parentMessage)- Wraps this error message into a new one that is returned as
a parent error message.
|
SVNErrorMessage | wrap(String parentMessage, Object relatedObject)- Wraps this error message into a new one that is returned as
a parent error message.
|
TYPE_ERROR
public static final int TYPE_ERROR
Error messages of this type are considered to be errors (most critical) rather
than warnings.
TYPE_WARNING
public static final int TYPE_WARNING
Error messages of this type are considered to be warnings, what in certain
situations may be OK.
UNKNOWN_ERROR_MESSAGE
public static SVNErrorMessage UNKNOWN_ERROR_MESSAGE
This is a type of an error message denoting an error of an unknown nature.
This corresponds to an
SVNErrorCode.UNKNOWN error.
SVNErrorMessage
protected SVNErrorMessage(SVNErrorCode code,
String message,
Object[] relatedObjects,
int type)
create
public static SVNErrorMessage create(SVNErrorCode code,
String message) Creates an error message given an error code and description.
code - an error codemessage - an error description
create
public static SVNErrorMessage create(SVNErrorCode code,
String message,
Object object) Creates an error message given an error code, description and may be a related
object to be formatted with the error description.
To format the provided object with the message, you
should use valid format patterns parsable for MessageFormat.
code - an error codemessage - an error descriptionobject - an object related to the error message
create
public static SVNErrorMessage create(SVNErrorCode code,
String message,
Object object,
int type) Creates an error message given an error code, description, an error type
(whether it's a warning or an error) and may be a related object to be
formatted with the error description. To format the provided object
with the message, you should use valid format patterns parsable for
MessageFormat.
code - an error codemessage - an error descriptionobject - an object related to the error messagetype - an error type
create
public static SVNErrorMessage create(SVNErrorCode code,
String message,
Object[] objects) Creates an error message given an error code, description and may be related
objects to be formatted with the error description.
To format the provided objects with the message, you
should use valid format patterns parsable for MessageFormat.
code - an error codemessage - an error descriptionobjects - an array of objects related to the error message
create
public static SVNErrorMessage create(SVNErrorCode code,
String message,
Object[] objects,
int type) Creates an error message given an error code, description, an error type
(whether it's a warning or an error) and may be related objects to be
formatted with the error description. To format the provided objects
with the message, you should use valid format patterns parsable for
MessageFormat.
code - an error codemessage - an error descriptionobjects - an array of objects related to the error messagetype - an error type
create
public static SVNErrorMessage create(SVNErrorCode code,
String message,
int type) Creates an error message given an error code, description and a type (
whether it's a warning or an error).
code - an error codemessage - an error descriptiontype - an error type
getChildErrorMessage
public SVNErrorMessage getChildErrorMessage()
Returns an error message (if any) that was returned from a
deeper method call. So the topmost error messages have the
entire chain of error messages down to the real error cause.
- a child error message object (if this object is not the
first one)
getErrorCode
public SVNErrorCode getErrorCode()
Returns the error code of the error.
- th error code of the error
getFullMessage
public String getFullMessage()
Gets a string representation of the entire stack trace of
error messages (if they were provided) starting with the initial
cause of the error.
- a string representing a full list of error messages
getMessage
public String getMessage()
Returns an error description formatted with the
related objects if needed. This call is equivalent to
a call to
toString()
getMessageTemplate
public String getMessageTemplate()
Returns an error description which may contain message format
patterns.
getRelatedObjects
public Object[] getRelatedObjects()
Returns objects (if any) that were provided to be formatted
with the error description. Objects are formatted by the standard
MessageFormat engine.
getType
public int getType()
Returns the type of the error (whether it's a warning or an error).
- the type of this error message
hasChildErrorMessage
public boolean hasChildErrorMessage()
Says if this error message object has got a child error message.
- true if has,
false otherwise (for
example, an initial error message would not have a child
error message)
isWarning
public boolean isWarning()
Returns true if this message is a warning message, not error one.
setChildErrorMessage
public void setChildErrorMessage(SVNErrorMessage childMessage)
Sets a child error message for this one.
childMessage - a child error message
toString
public String toString()
Returns a string representation of this error message object
formatting (if needed) the error description with the provided related objects.
If no error description pattern has been provided, the return
value includes a string representation of the error code (see
SVNErrorCode).
- a string representing this object.
wrap
public SVNErrorMessage wrap(String parentMessage)
Wraps this error message into a new one that is returned as
a parent error message. A parent message is set the error code
of this error message, a new error description and this error
message as its child.
parentMessage - a parent error description
wrap
public SVNErrorMessage wrap(String parentMessage,
Object relatedObject) Wraps this error message into a new one that is returned as
a parent error message. A parent message is set the error code
of this error message, a new error description and this error
message as its child.
parentMessage - a parent error descriptionrelatedObject - an object to be formatted with parentMessage
Copyright © 2004-2006 TMate Software Ltd. All Rights Reserved.