public class

ServiceError

extends Object
java.lang.Object
   ↳ com.google.api.gbase.client.ServiceError

Class Overview

One error found in the body of a ServiceException or in the content of a BatchStatus.

See Also

Summary

Constants
String DATA_TYPE The {@value #DATA_TYPE} error type.
String REQUEST_TYPE The {@value #REQUEST_TYPE} error type.
Fields
private final String field
private final String reason
private final String type
Public Constructors
ServiceError(String type, String field, String reason)
Creates a new error.
ServiceError(String reason)
Creates a new error with just an error message.
Public Methods
String getField()
Gets the error field.
String getReason()
Gets the error message (plain text).
String getType()
Gets the error type.
String toString()
Returns a convenient string representation.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String DATA_TYPE

The {@value #DATA_TYPE} error type.

Constant Value: "data"

public static final String REQUEST_TYPE

The {@value #REQUEST_TYPE} error type.

Constant Value: "request"

Fields

private final String field

private final String reason

private final String type

Public Constructors

public ServiceError (String type, String field, String reason)

Creates a new error.

Parameters
type Error type, may be null, DATA_TYPE or REQUEST_TYPE
field Error field, may be null
reason Error message

public ServiceError (String reason)

Creates a new error with just an error message.

Parameters
reason Error message

Public Methods

public String getField ()

Gets the error field.

Returns
  • error field or null

public String getReason ()

Gets the error message (plain text).

Returns
  • error message

public String getType ()

Gets the error type.

Returns
  • error type or null

public String toString ()

Returns a convenient string representation.

Returns
  • a string representation