Beispiel #1
0
package main

import (
	"v.io/v23/context"
	"v.io/v23/i18n"
	"v.io/v23/verror"
)

var _ = __VDLInit() // Must be first; see __VDLInit comments for details.

//////////////////////////////////////////////////
// Error definitions

var (
	ErrKeyRejected = verror.Register("v.io/x/lock/lock.KeyRejected", verror.NoRetry, "{1:}{2:} receiver rejected key {3} for lock {4}")
)

// NewErrKeyRejected returns an error with the ErrKeyRejected ID.
func NewErrKeyRejected(ctx *context.T, key string, lock string) error {
	return verror.New(ErrKeyRejected, ctx, key, lock)
}

var __VDLInitCalled bool

// __VDLInit performs vdl initialization.  It is safe to call multiple times.
// If you have an init ordering issue, just insert the following line verbatim
// into your source files in this package, right after the "package foo" clause:
//
//    var _ = __VDLInit()
//
Beispiel #2
0
		switch done, elem, err := dec.NextEntryValueUint(32); {
		case err != nil:
			return err
		case done:
			return dec.FinishValue()
		default:
			*x = append(*x, uint32(elem))
		}
	}
}

//////////////////////////////////////////////////
// Error definitions

var (
	ErrNoFortunes = verror.Register("v.io/x/jni/test/fortune.NoFortunes", verror.NoRetry, "{1:}{2:} no fortunes added")
	ErrComplex    = verror.Register("v.io/x/jni/test/fortune.Complex", verror.NoRetry, "{1:}{2:} this is a complex error with params {3} {4} {5}")
)

// NewErrNoFortunes returns an error with the ErrNoFortunes ID.
func NewErrNoFortunes(ctx *context.T) error {
	return verror.New(ErrNoFortunes, ctx)
}

// NewErrComplex returns an error with the ErrComplex ID.
func NewErrComplex(ctx *context.T, first ComplexErrorParam, second string, third int32) error {
	return verror.New(ErrComplex, ctx, first, second, third)
}

//////////////////////////////////////////////////
// Interface definitions
Beispiel #3
0
package main

import (
	"v.io/v23/context"
	"v.io/v23/i18n"
	"v.io/v23/verror"
)

var _ = __VDLInit() // Must be first; see __VDLInit comments for details.

//////////////////////////////////////////////////
// Error definitions

var (
	ErrLockAlreadyClaimed = verror.Register("v.io/x/lock/lockd.LockAlreadyClaimed", verror.NoRetry, "{1:}{2:} lock has already been claimed")
	ErrInvalidLockName    = verror.Register("v.io/x/lock/lockd.InvalidLockName", verror.NoRetry, "{1:}{2:} invalid lock name ({3}: cannot contain {4})")
)

// NewErrLockAlreadyClaimed returns an error with the ErrLockAlreadyClaimed ID.
func NewErrLockAlreadyClaimed(ctx *context.T) error {
	return verror.New(ErrLockAlreadyClaimed, ctx)
}

// NewErrInvalidLockName returns an error with the ErrInvalidLockName ID.
func NewErrInvalidLockName(ctx *context.T, name string, reason string) error {
	return verror.New(ErrInvalidLockName, ctx, name, reason)
}

var __VDLInitCalled bool