Documentation ¶
Overview ¶
Error types and error functions for the ogonori library
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStaleGlobalProperties error
Functions ¶
func ExtractCause ¶
ExtractCause will recurse down a "stack" of Trace errors until it gets to an error that is not of type Trace and return that. If an error not of type Trace is passed it, it is simply returned.
func GetFullTrace ¶
GetFullTrace extracts an error "stack" trace for the Trace error wrappers down to the ultimate cause. If a non-Trace error is passed in then just the "Cause" info is returned.
Types ¶
type ErrDataTypeMismatch ¶
type ErrDataTypeMismatch struct { ExpectedDataType oschema.ODataType ExpectedGoType string ActualValue interface{} }
InvalidDatabaseType is an Error that indicates that the db type value is not one that the OrientDB server will recognize. For OrientDB 2.x, the valid types are "document" or "graph". Constants for these values are provided in the obinary ogonori code base.
func (ErrDataTypeMismatch) Error ¶
func (e ErrDataTypeMismatch) Error() string
type ErrInvalidConn ¶
type ErrInvalidConn struct {
Msg string
}
func (ErrInvalidConn) Error ¶
func (e ErrInvalidConn) Error() string
type IncorrectNetworkRead ¶
func (IncorrectNetworkRead) Error ¶
func (e IncorrectNetworkRead) Error() string
type InvalidDatabaseType ¶
type InvalidDatabaseType struct {
TypeRequested string
}
InvalidDatabaseType is an Error that indicates that the db type value is not one that the OrientDB server will recognize. For OrientDB 2.x, the valid types are "document" or "graph". Constants for these values are provided in the obinary ogonori code base.
func (InvalidDatabaseType) Error ¶
func (e InvalidDatabaseType) Error() string
type OServerException ¶
OServerException encapsulates Java-based Exceptions from the OrientDB server. OrientDB can return multiple exceptions for a single query/command, so they are all encapsulated in one ogonori OServerException object. Class = Java exception class Message = error message from the server
func (OServerException) Error ¶
func (e OServerException) Error() string
type SessionNotInitialized ¶
type SessionNotInitialized struct{}
SessionNotInitialized is an Error that indicates that no session was started before trying to issue a command to the OrientDB server or one of its databases.
func (SessionNotInitialized) Error ¶
func (e SessionNotInitialized) Error() string
type Trace ¶
Trace is a wrapper struct for errors so we can preseve information about the call stack an error passes through. Trace implements the Error interface.
func NewTrace ¶
NewTrace creates a Trace Error wrapper that retains the underlying error ("cause") and the filename and line number of the previous call where 2 is subtracted from the line number. So it's usage is appropriate with this form of code:
err = DoSomething() if err != nil { return oerror.NewTrace(err) // line - 2 refers to the DoSomething() line }